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

Pandas sort deprecated in new charts, use sort_values instead #3014

Closed
chdoig opened this issue Oct 22, 2015 · 7 comments · Fixed by #3894
Closed

Pandas sort deprecated in new charts, use sort_values instead #3014

chdoig opened this issue Oct 22, 2015 · 7 comments · Fixed by #3894
Assignees
Milestone

Comments

@chdoig
Copy link
Contributor

chdoig commented Oct 22, 2015

Getting this deprecation warning when using the new charts.

/anaconda/envs/training/lib/python3.4/site-packages/bokeh/charts/_attributes.py:78: FutureWarning: sort(columns=....) is deprecated, use sort_values(by=.....)
  df = df.sort(columns=columns)

Switch to using sort_values instead.

cc: @fpliger

@spawnrider
Copy link

Just had the same waning. See below :

d:\dev\python34\lib\site-packages\bokeh\charts\_attributes.py:78: FutureWarning: sort(columns=....) is deprecated, use sort_values(by=.....)
  df = df.sort(columns=columns)

@bryevdv
Copy link
Member

bryevdv commented Jan 15, 2016

There's not much we can do about this now, Pandas changed upstream, which is out of our control. If we move to sort_values then still-very-recent versions of Pandas will no longer work, which seems more undesirable than the warning.

@fpliger
Copy link
Contributor

fpliger commented Jan 15, 2016

wait... this should be fixed! I made a change to use sort_values and use sort in case of the exception for older versions of pandas...

(didn't do this for examples though)

@bryevdv
Copy link
Member

bryevdv commented Jan 15, 2016

Maybe something slipped though? If there is a "compat" layer (I do seem to recall that now) then it would be great to use it on these cases.

@fpliger
Copy link
Contributor

fpliger commented Jan 15, 2016

@bryevdv here's part of the fixes that I'm referring to: https://github.com/bokeh/bokeh/blob/master/bokeh/charts/attributes.py#L149-L152

I'm confused... the PR that is referring to this issue ( #3637 ) has nothing to do with with it. It's instead mostly docs and flakes fixes... Maybe it's because of a PR title (and intent) change?

@bryevdv
Copy link
Member

bryevdv commented Jan 15, 2016

#3637 originally update to sort_values directly but that change was reverted.

Edit: it originally had this commit: 42c9505 But was reverted for the reason I gave (would break with older versions pandas) so now that PR has nothing to do with this issue anymore. It's not really relevant to fixing this issue, which should now happen separately, if at all.

The examples, I think we have to leave as-is but builder.py and donut_builder.py could be fixed in the way you show above.

@fpliger
Copy link
Contributor

fpliger commented Jan 15, 2016

Aaaah, now I see.. Yeap, this slipped. We can create a compat at bokeh level and put it there.. Otherwise, as it's a charts only thing we can just use charts.utils.

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

Successfully merging a pull request may close this issue.

5 participants