Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken: tests/coops_test.py::test_coops_data_products_w_date_input[7-cb1101-currents] #168

Open
pmav99 opened this issue Sep 26, 2024 · 0 comments

Comments

@pmav99
Copy link
Member

pmav99 commented Sep 26, 2024

The test of the title is broken.

This is what is causing the failure of CI/CD too.

https://github.com/oceanmodeling/searvey/blob/4d23de7bd5a9ffe363f5d299e96a5a3bce6bc8ed/.github/workflows/install_from_pypi.yml
https://github.com/oceanmodeling/searvey/actions/runs/11046019490/job/30684650806

ERROR    searvey._coops_api:_coops_api.py:262 cb1101: Encountered an error response for {'station_id': 'cb1101', 'url': URL('https://api.tidesandcurrents.noaa.gov/api/prod/datagetter?station=cb1101&product=currents&datum=MSL&units=metric&time_zone=gmt&format=json&application=oceanmodeling%2Fstormevents&begin_date=20240919%2005%3A17&end_date=20240926%2005%3A17'), 'client': <httpx.Client object at 0x7f99a7a70b60>, 'rate_limit': <multifutures._rate_limit.RateLimit object at 0x7f99a7a70f20>, 'product': <COOPS_Product.CURRENTS: 'currents'>, 'redirect': True}!
ERROR    searvey._coops_api:_coops_api.py:263 --> No data was found. This product may not be offered at this station at the requested time.
WARNING  searvey._coops_api:_coops_api.py:390 COOPS-cb1101: No data. Creating a dummy dataframe
=========================== short test summary info ============================
FAILED tests/coops_test.py::test_coops_data_products_w_date_input[7-cb1101-currents] - TypeError: Invalid comparison between dtype=datetime64[ns] and Timestamp
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!

The problem is that the test is written in a way that tries to retrieve the last N days of data since the current day. This is fragile because if a station gets offline or something then we might not get any data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant