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

FutureWarning in Pandas 0.24.0 #1314

Closed
iaindillingham opened this issue Jan 28, 2019 · 8 comments
Closed

FutureWarning in Pandas 0.24.0 #1314

iaindillingham opened this issue Jan 28, 2019 · 8 comments

Comments

@iaindillingham
Copy link
Contributor

Pandas 0.24.0 throws a FutureWarning when used with Altair 2.3.0 here, which prevents the chart being rendered correctly. The message:

[my_virtualenv]/lib/python3.6/site-packages/altair/utils/core.py:294: FutureWarning: A future version of pandas will default to `skipna=True`. To silence this warning, pass `skipna=True|False` explicitly.

I notice that Altair's requirements.txt doesn't specify version. Would it be worth doing so?

@afonit
Copy link
Contributor

afonit commented Jan 28, 2019

@iaindillingham I just upgraded to pandas 0.24.0 and am using altair 2.3.0.
I am not getting the error you are seeing, my plots are showing up fine.

What platform are you on?
To confirm from what you said, did you get the error upon import of altair or after import and when plotting data?

@iaindillingham
Copy link
Contributor Author

Python 3.6 on Ubuntu 18.04. The error was raised when plotting data, not upon import. I'll try and reproduce.

@afonit
Copy link
Contributor

afonit commented Jan 28, 2019

I have now gotten the error.
Interesting - it is happening on some of my plots and not on others. I am trying to narrow it down.

@afonit
Copy link
Contributor

afonit commented Jan 28, 2019

@iaindillingham
So far I can get it to come up if I am not declaring types for the fields.

For example:

x='actual'
vs
x='actual:Q'

Is that the case for you - that if you declare the type you don't get the error?

@jakevdp
Copy link
Collaborator

jakevdp commented Jan 28, 2019

It looks like the warning is in pandas infer_dtype function, which we use in automatically determining the data type when not specified by the user here.

@iaindillingham
Copy link
Contributor Author

Yes, @afonit that's correct. Although only when I use the shorthand syntax, not when I supply a type kwarg.

@jakevdp
Copy link
Collaborator

jakevdp commented Jan 28, 2019

Fix is to explicitly pass skipna=False in this line: https://github.com/altair-viz/altair/blob/c4495f965db621e8bd0c2b3dd0390ef30ad33456/altair/utils/core.py#L72

We'll have to do it carefully, though, because prior to pandas 0.20.0, infer_dtype takes no keyword arguments.

@jakevdp
Copy link
Collaborator

jakevdp commented Jan 28, 2019

I pushed a fix in #1315

jakevdp added a commit that referenced this issue Jan 29, 2019
BUG: specify skipna in infer_dtypes (fixes #1314)
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

No branches or pull requests

3 participants