Skip to content

Inconsistent output for what_sites and get_info #78

Description

@SorooshMani-NOAA

When the input parameters of what_sites and get_info results in empty data set, the return value is a dataframe with different columns names. Instead one would expect an empty dataframe with the same columns as the normal output.

Example:

nwis.what_sites(**{'stateCd': 'ny', 'parameterCd': ['00056', '00058', '00059', '50051', '74072'], 'hasDataType': 'iv'})

results in (correctly)

(  agency_cd          site_no  station_nm site_tp_cd  dec_lat_va  dec_long_va coord_acy_cd dec_coord_datum_cd  alt_va  alt_acy_va alt_datum_cd   huc_cd
 0      USGS  405412072251201  S133926. 1         GW   40.903333   -72.420000            S              NAD83   95.15         5.0       NAVD88  2030202
 1      USGS  425227073212401      RE 108         GW   42.874375   -73.356731            H              NAD83  451.00         4.3       NAVD88  2020003
 2      USGS  425237073210903      RE 293         GW   42.877197   -73.352694            H              NAD83  430.20         1.0       NAVD88  2020003,
 <dataretrieval.utils.Metadata at 0x2b06b7d7ba60>)

while

nwis.what_sites(**{'stateCd': 'fl', 'parameterCd': ['00056', '00058', '00059', '50051', '74072'], 'hasDataType': 'iv'})

results in

(Empty DataFrame
 Columns: [<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Error report</title><style type="text/css"><!--H1 {font-family:TahomaArialsans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:TahomaArialsans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:TahomaArialsans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:TahomaArialsans-serif;color:black;background-color:white;} B {font-family:TahomaArialsans-serif;color:white;background-color:#525D76;} P {font-family:TahomaArialsans-serif;background:white;color:black;font-size:12px;}A {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - No sites found matching this request server=[sdas01]</h1><hr/><p><b>type</b> Status report</p><p><b>message</b>No sites found matching this request server=[sdas01]</p><p><b>description</b>The requested resource is not available.</p><hr/><h3>Error Report</h3></body></html>]
 Index: [],
 <dataretrieval.utils.Metadata at 0x2b06b7d7f730>)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions