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

Fix dataretrieval dependency #112

Merged

Conversation

SorooshMani-NOAA
Copy link
Contributor

USGS dataretrieval-python packages has refactored some of the classes that used to be imported in searvey for typing annotation

@SorooshMani-NOAA
Copy link
Contributor Author

@pmav99 I see a mypy error on GitHub that I don't get on my local machine. I'm not sure what to do about it! It probably has something to do with updated versions in poetry.lock. Even though I called poetry install after updating the lock on my machine, I still don't get the error I see here!

Do you have any suggestions?

@SorooshMani-NOAA SorooshMani-NOAA self-assigned this Sep 29, 2023
@pmav99
Copy link
Member

pmav99 commented Sep 29, 2023

To reproduce it locally, you probably need to run poetry update. After poetry update you probably need make deps to update the requirements.txt files, too.

To fix the mypy issue Add this patch:

diff --git a/searvey/erddap.py b/searvey/erddap.py
index 95fa99c..f3d989a 100644
--- a/searvey/erddap.py
+++ b/searvey/erddap.py
@@ -36,7 +36,7 @@ def urlopen(
     try:
         response.raise_for_status()
     except requests.exceptions.HTTPError as err:
-        raise requests.exceptions.HTTPError(f"{response.content.decode()}") from err
+        raise requests.exceptions.HTTPError(f"{response.content.decode()}") from err  # type: ignore[call-arg]
     data = io.BytesIO(response.content)

Unfortunately I don't recall why I was reraising the exception. Probably some issue with some erddap server I was testing. For now let's just ignore the error.

@SorooshMani-NOAA
Copy link
Contributor Author

@pmav99 thank you for your help, I forgot to mention that I did poetry lock and then poetry install which is equivalent to the poetry update as far as I understand, right? In any case I'll add the patch for mypy and rerun the tests. Thank you again!

@codecov
Copy link

codecov bot commented Oct 2, 2023

Codecov Report

Merging #112 (6b003a5) into master (91a10ad) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #112   +/-   ##
=======================================
  Coverage   90.04%   90.04%           
=======================================
  Files          13       13           
  Lines        1015     1015           
  Branches      151      151           
=======================================
  Hits          914      914           
  Misses         55       55           
  Partials       46       46           
Files Coverage Δ
searvey/erddap.py 95.00% <100.00%> (ø)
searvey/usgs.py 92.59% <100.00%> (ø)

@SorooshMani-NOAA SorooshMani-NOAA merged commit 3f36f71 into oceanmodeling:master Oct 2, 2023
12 checks passed
@SorooshMani-NOAA SorooshMani-NOAA deleted the bugfix/usgs_dependency branch October 2, 2023 12:52
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 this pull request may close these issues.

2 participants