Skip to content

Commit

Permalink
Fix for issue #320 (#326)
Browse files Browse the repository at this point in the history
* Update reader.py

* Update reader.py

* Update reader.py
  • Loading branch information
pavan-kumar-chalamcharla authored Jun 14, 2023
1 parent 60abca1 commit 2861367
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/delta_sharing/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from typing import Any, Callable, Dict, Optional, Sequence
from urllib.parse import urlparse
from json import loads
from urllib.request import getproxies

import fsspec
import pandas as pd
Expand Down Expand Up @@ -158,7 +159,11 @@ def _to_pandas(
import delta_sharing._yarl_patch # noqa: F401

protocol = url.scheme
filesystem = fsspec.filesystem(protocol)
proxy = getproxies()
if len(proxy) != 0:
filesystem = fsspec.filesystem(protocol, client_kwargs={"trust_env":True})
else:
filesystem = fsspec.filesystem(protocol)

pa_dataset = dataset(source=action.url, format="parquet", filesystem=filesystem)
pa_table = pa_dataset.head(limit) if limit is not None else pa_dataset.to_table()
Expand Down

0 comments on commit 2861367

Please sign in to comment.