ioos / erddapy

Python interface for ERDDAP
https://ioos.github.io/erddapy/
BSD 3-Clause "New" or "Revised" License
77 stars 30 forks source link

TypeError with .to_xarray() #137

Closed abkfenris closed 4 years ago

abkfenris commented 4 years ago

In 0.7.0 or 0.7.1 I'm getting a TypeError: a bytes-like object is required, not '_io.BytesIO' when calling .to_xarray() in some cases from _tempnc()

https://github.com/ioos/erddapy/blob/29b82922ad5293614745180e431638c89e2cd494/erddapy/utilities.py#L123-L136

I'm trying to figure out a minimal example, but so far I have a gulfofmaine/buoy_barn test that throws.

I initially thought that it was because I'm using VCRpy to mock out traffic to various servers, but I'm having it occur outside of testing also.

Here's a Sentry issue with the exception.

ocefpaf commented 4 years ago

I think I know what it is. Hold on...

ocefpaf commented 4 years ago

OK. Update, I teste that agains v0.7.0 and v0.6.0. I'm not so sure of the problem now. Still investigating. Did that ever work? Has something changed in the data recently?

PS: downloading the data and loading manually works :-/

abkfenris commented 4 years ago

It worked prior to 0.6.0.

I've been focused on the front end of this project today, and hunting down a N+1 issue that was causing thousands of queries when a handful would do, so I haven't gotten back to trying to isolate it more, but it looks like you may have something in #138

ocefpaf commented 4 years ago

0.5.3 works and I tracked to changes in urlopen that were hidden due to the fact that in-memory netcdf was working for virtually all datasets. #138 fixes it but I need to add figure out why in-memory did not work for this particular case and add more tests for both cases.

ocefpaf commented 4 years ago

Should be fixed in #138. I'm preparing a new release in #144.