Closed bbest closed 1 year ago
Thank you so much @bbest for highlighting this! It appears to be a warning thrown by pandas
when we are concatenating new JSON data to already fetched data and all columns are by default set as object
type.
I will try to resolve this by introducing a type-casting for all boolean value columns.
This issue is fixed in #113.
Looks like I'm getting this FutureWarning as well.
C:\Users\Mathew.Biddle\programs\Miniforge\envs\IOOS\Lib\site-packages\pyobis\occurrences\occurrences.py:167: FutureWarning: In a future version, object-dtype columns with all-bool values will not be included in reductions with bool_only=True. Explicitly cast to bool dtype instead.
outdf = pd.concat([outdf, pd.DataFrame(res["results"])], ignore_index=True)
In[5]: pyobis.__version__
Out[5]: '1.2.6'
Thanks @MathewBiddle for reporting. It appears that the version you are using is the one published on PyPI. We fixed it in #113 and it is not currently published. We are working to resolve #116 and then push a new release.
With the new release v1.3.0
this issue seems to have resolved?
Looks like it's fixed now. Need to completely re-write my code with the new version though. I feel the jump from v1.2.6
to v1.3.0
breaks backward compatibility and should have been a major version change. See https://semver.org/.
BTW, from a user perspective, warnings are not a big deal. With that said, for developers, specially Future/Deprecation warnings, should be something we pay attention to. @ayushanand18 the best way to keep track of those is to turn warnings into errors. See https://docs.pytest.org/en/7.1.x/how-to/capture-warnings.html#controlling-warnings.
Thank you @ocefpaf for the resource. Turning warnings into errors is the best thing, and I'll keep my dev environment updated to catch warnings while making changes.
When running this...
I see this warning:
/opt/homebrew/lib/python3.10/site-packages/pyobis/occurrences/occurrences.py:167
: FutureWarning: