Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Consider necessary columns from complex arguments when interchanging dataframes #4324

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

Merged
alexcjohnson merged 5 commits into plotly:master from guyrosin:fix-necessary-columns
Aug 15, 2023

Conversation

@guyrosin
Copy link
Contributor

@guyrosin guyrosin commented Aug 13, 2023

This PR fixes a regression from #4286, where only plain string arguments were considered as necessary columns when interchanging dataframes. This PR considers complex arguments as well (such as hover_data).

For example, running the code below resulted in ValueError: Value of 'hover_data_0' is not the name of a column in 'data_frame'. Expected one of ['petal_length', 'sepal_length'] but received: species

import numpy as np
import plotly.express as px
import polars as pl
df = px.data.iris()
px.scatter(
 pl.from_pandas(df),
 x="petal_length",
 y="sepal_length",
 hover_data=["species"], # <-- this was unsupported
)
  • I have read through the contributing notes and understand the structure of the package. In particular, if my PR modifies code of plotly.graph_objects, my modifications concern the codegen files and not generated files.
  • I have added tests (if submitting a new feature or correcting a bug) or
    modified existing tests.
  • For a new feature, I have added documentation examples in an existing or
    new tutorial notebook (please see the doc checklist as well).
  • I have added a CHANGELOG entry if fixing/changing/adding anything substantial.
  • For a new feature or a change in behaviour, I have updated the relevant docstrings in the code to describe the feature or behaviour (please see the doc checklist as well).

Copy link
Collaborator

Thanks so much @guyrosin ! Would you add a changelog entry, in a new ## UNRELEASED section at the top? Then I think this is ready to go, and we'll try to get a patch out shortly.

Copy link
Contributor Author

guyrosin commented Aug 15, 2023
edited
Loading

Done. That's great to hear! Thanks @alexcjohnson for the feedback

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃 Very nice! Thanks again for identifying AND fixing this regression @guyrosin

guyrosin reacted with heart emoji
@alexcjohnson alexcjohnson merged commit 402c9b4 into plotly:master Aug 15, 2023
@guyrosin guyrosin deleted the fix-necessary-columns branch August 23, 2023 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@alexcjohnson alexcjohnson alexcjohnson approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /