Skip to content

Commit

Permalink
Merge pull request #338 from ocefpaf/get_info_url
Browse files Browse the repository at this point in the history
Allow for empty dataset_id info URL
  • Loading branch information
ocefpaf authored Mar 8, 2024
2 parents 5e45a0e + 3776868 commit f2947fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 3 additions & 4 deletions erddapy/core/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,17 +343,16 @@ def get_info_url(
----
server: data server endpoint.
dataset_id: a dataset unique id.
If empty the full dataset listing will be returned.
response: default is HTML.
Returns:
-------
url: the info URL for the `response` chosen.
"""
if not dataset_id:
msg = f"You must specify a valid dataset_id, got {dataset_id}"
raise ValueError(msg)

if dataset_id is None:
return f"{server}/info/index.{response}?itemsPerPage=1000000"
return f"{server}/info/{dataset_id}/index.{response}"


Expand Down
7 changes: 6 additions & 1 deletion erddapy/erddapy.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ def get_info_url(
Args:
----
dataset_id: a dataset unique id.
If empty the full dataset listing will be returned.
response: default is HTML.
Returns:
Expand All @@ -273,7 +274,11 @@ def get_info_url(
dataset_id = dataset_id if dataset_id else self.dataset_id
response = response if response else self.response

return get_info_url(self.server, dataset_id, response)
return get_info_url(
self.server,
dataset_id=dataset_id,
response=response,
)

def get_categorize_url(
self: ERDDAP,
Expand Down

0 comments on commit f2947fc

Please sign in to comment.