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

Pass tuple to get_group to fix warning #4519

Merged
merged 2 commits into from
Feb 15, 2024
Merged

Pass tuple to get_group to fix warning #4519

merged 2 commits into from
Feb 15, 2024

Conversation

LiamConnors
Copy link
Contributor

@LiamConnors LiamConnors commented Feb 13, 2024

#4500

Code PR

  • 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).

@LiamConnors LiamConnors changed the title Silence FutureWarning: When grouping with a length-1 list-like... Pass tuple to get_group to fix warning Feb 13, 2024
@alexcjohnson
Copy link
Collaborator

@LiamConnors this looks great! Can we add a test, perhaps in test_px_input.py but similar to this one in test_px_wide.py? And I guess increase the pandas version in requirements_39_pandas_2_optional.txt to 2.2?

with warnings.catch_warnings(record=True) as warn_list:
_ = px.bar(
df,
x=df.index,
y=df.columns[:-2],
labels=df.columns[:-2],
)
performance_warnings = [
warn
for warn in warn_list
if issubclass(warn.category, pd.errors.PerformanceWarning)
]
assert len(performance_warnings) == 0, "PerformanceWarning(s) raised!"

@LiamConnors
Copy link
Contributor Author

Thanks! @alexcjohnson! I've added a test now

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.

💃 Beautiful! Just wants a changelog entry.

@LiamConnors LiamConnors merged commit 2451671 into master Feb 15, 2024
5 checks passed
@LiamConnors LiamConnors deleted the fix-grouping branch February 15, 2024 14:16
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

Successfully merging this pull request may close these issues.

None yet

2 participants