-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
BUG: Fix ValueError in Series.info(show_counts=False) #62699
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: Fix ValueError in Series.info(show_counts=False) #62699
Conversation
Hi @Nithurshen , pandas/pandas/tests/frame/test_query_eval.py Line 162 in 066a4f7
Currently I am testing my local environment and when I do |
Is it due to my commits? Or is it another bug? |
First of all, thank you for verifying my commits. Second, if you feel it is a bug, then please open an issue and I'm more than happy to work on it. |
Sure, Thanks. I worked on it. |
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.
You need to add a test for the case that failed in tests/series/test_info.py
Added a test in Test code: def test_info_show_counts_false():
# GH#62590
s = Series([1, 2, None])
buf = StringIO()
s.info(buf=buf, show_counts=False)
result = buf.getvalue()
assert "Non-Null Count" not in result
assert "<class 'pandas.Series'>" in result
assert "Dtype" in result |
pd.Series(show_counts=False)
is broken #62590doc/source/whatsnew/v3.0.0.rst
file if fixing a bug or adding a new feature.This pull request addresses a ValueError that occurs when calling
Series.info(show_counts=False)
.The root cause of the bug was in the
_SeriesTableBuilderVerbose._gen_rows_without_counts
method, which was incorrectly yielding a raw string for the Dtype (e.g., 'int64') instead of a sequence (e.g., ['int64']). A downstream formatting function then attempted to zip() this string, treating it as a sequence of characters, which led to an argument length mismatch and raised the ValueError.The fix ensures the method yields the Dtype string wrapped in a list, providing the correct data structure and preventing the crash.