Skip to content

BUG FIX: None of the included dtypes present in df will raise ValueError with clear error message. #61871

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

khemkaran10
Copy link

Before Fix:

>>> df = pd.DataFrame({"a": [1, 2, 3]})
>>> df.describe(include=["datetime"])
...
ValueError: No objects to concatenate

After Fix:

>>> df = pd.DataFrame({"a": [1, 2, 3]})
>>> df.describe(include=["datetime"])
...
ValueError: None of the included dtypes are present in the DataFrame

@khemkaran10
Copy link
Author

pre-commit.ci autofix

@mroeschke mroeschke added the Error Reporting Incorrect or improved errors from pandas label Jul 16, 2025
@khemkaran10
Copy link
Author

df = pd.DataFrame({"a": [1, 2, 3]})
df.describe(exclude=[np.int64])
...
ValueError: None of the included dtypes are present in the DataFrame

After the fix, this example will also show the same error. Should we change the error message to something like,
No columns match the specified include or exclude data types

@khemkaran10 khemkaran10 requested a review from mroeschke July 16, 2025 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: describe(include=..) fails with unrelated error if provided data types are not present
2 participants