Skip to content

Commit

Permalink
Remove remaining ** from urlopen methods
Browse files Browse the repository at this point in the history
  - Code review for ioos#280
  • Loading branch information
vinisalazar committed Nov 30, 2022
1 parent 85d41cf commit 2349bff
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion erddapy/core/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def to_pandas(
requests_kwargs = {}
if pandas_kwargs is None:
pandas_kwargs = {}
data = urlopen(url, **requests_kwargs)
data = urlopen(url, requests_kwargs)
try:
return pd.read_csv(data, **pandas_kwargs)
except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion erddapy/core/netcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def _nc_dataset(url, **requests_kwargs: Dict):
"""Return a netCDF4-python Dataset from memory and fallbacks to disk if that fails."""
from netCDF4 import Dataset

data = urlopen(url=url, **requests_kwargs)
data = urlopen(url, requests_kwargs)
try:
return Dataset(Path(urlparse(url).path).name, memory=data.read())
except OSError:
Expand Down
3 changes: 1 addition & 2 deletions erddapy/core/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def _urlopen(url: str, auth: Optional[tuple] = None, **kwargs: Dict) -> BinaryIO

def urlopen(
url: str,
auth: Optional[tuple] = None,
requests_kwargs: Optional[Dict] = None,
) -> BinaryIO:
"""Thin wrapper around httpx get content.
Expand All @@ -39,7 +38,7 @@ def urlopen(
# Ignoring type checks here b/c mypy does not support decorated functions.
if requests_kwargs is None:
requests_kwargs = {}
data = _urlopen(url=url, auth=auth, **requests_kwargs) # type: ignore
data = _urlopen(url, **requests_kwargs) # type: ignore
data.seek(0)
return data

Expand Down
2 changes: 1 addition & 1 deletion erddapy/erddapy.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def _get_variables(self, dataset_id: OptionalStr = None) -> Dict:
url = self.get_info_url(dataset_id=dataset_id, response="csv")

variables = {}
data = urlopen(url, auth=self.auth, **self.requests_kwargs)
data = urlopen(url, self.requests_kwargs)
_df = pd.read_csv(data)
self._dataset_id = dataset_id
for variable in set(_df["Variable Name"]):
Expand Down

0 comments on commit 2349bff

Please sign in to comment.