Skip to content

Commit

Permalink
[DOI-USGS#135] convert boolean type query parameters to string type
Browse files Browse the repository at this point in the history
  • Loading branch information
pkdash committed Apr 22, 2024
1 parent 353240a commit 84cd690
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dataretrieval/nldi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

def _query_nldi(url, query_params, error_message):
# A helper function to query the NLDI API
response = query(url, query_params)
response = query(url, payload=query_params)
if response.status_code != 200:
raise ValueError(f'{error_message}. Error reason: {response.reason}')

Expand Down Expand Up @@ -141,6 +141,8 @@ def get_basin(
raise ValueError('feature_id is required')

url = f'{NLDI_API_BASE_URL}/{feature_source}/{feature_id}/basin'
simplified = str(simplified).lower()
split_catchment = str(split_catchment).lower()
query_params = {'simplified': simplified, 'splitCatchment': split_catchment}
err_msg = (
f"Error getting basin for feature source '{feature_source}' and "
Expand Down

0 comments on commit 84cd690

Please sign in to comment.