Skip to content

Make a fastpath conditional on data is None #27475

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

Closed
wants to merge 1 commit into from
Closed

Make a fastpath conditional on data is None #27475

wants to merge 1 commit into from

Conversation

vanschelven
Copy link

As per the pre-existing comment in the code: this is a fastpath for the
case data is None. Better include an if-statement to make sure this
condition actually holds.

When this if-statement is not present, failure occurs at a later point
in the code when an empty index is used, because that later code expects data
to be array-like, but we convert to a scalar here.

====

NOTE: this is a "shoot from the hip" (completely untested) PR as it stands.
I hope it can contribute towards a solution nonetheless, but it needs at least
tests

As per the pre-existing comment in the code: this is a fastpath for the
case `data is None`. Better include an if-statement to make sure this
condition actually holds.

When this if-statement is not present, failure occurs at a later point
in the code when an empty index is used, because that later code expects data
to be array-like, but we convert to a scalar here.

fix #26469
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.

BUG: Series construction with EA dtype and index but no data fails
1 participant