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
BUG: Ignore warning for duplicate columns in to_dict
when orient='tight'
#58335
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Co-authored-by: Abdulaziz Aloqeely <52792999+Aloqeely@users.noreply.github.com>
Thank you for replying so quickly, all the comments are fixed. |
def test_to_dict_tight_no_warning_with_duplicate_column(self): | ||
# GH#58281 | ||
df = DataFrame([[1, 2], [3, 4], [5, 6]], columns=["A", "A"]) | ||
assert df.to_dict(orient="tight") == { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you still assert that df.to_dict(orient="tight")
doesn't raise a warning?
Also can you structure like
result =
expected =
assert result == expected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this time? Am I understanding correctly?
Thanks @luke396 |
…ight' (pandas-dev#58335) * Ignore warning for duplicate columns in to_dict when orient='tight' * Add whatsnew * Update doc/source/whatsnew/v3.0.0.rst Co-authored-by: Abdulaziz Aloqeely <52792999+Aloqeely@users.noreply.github.com> * Update whatsnew and redefine duplicate columns * Use assert instead * assert not raise and equal --------- Co-authored-by: Abdulaziz Aloqeely <52792999+Aloqeely@users.noreply.github.com>
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.