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

TYP: to_arrays, BUG: from_records empty dtypes #40121

Merged
merged 3 commits into from
Mar 1, 2021

Conversation

jbrockmendel
Copy link
Member

  1. the argument annotation for columns in to_arrays isnt quite right. this is fixed by adding an ensure_index inside DataFrame.__init__
  2. call ensure_index in the empty case in to_arrays so we can tighten from Tuple[Any, Any] to Tuple[Any, Index]`
  3. in the structured array case in to_arrays, return a list of empty ndarrays instead of list of empty lists, so we can further tighten to Tuple[List[ArrayLike], Index]
  4. This breaks test_from_records_empty_with_nonempty_fields_gh3682, at which point we decide that the new behavior is better, so calling it a bugfix.

@jreback
Copy link
Contributor

jreback commented Mar 1, 2021

+1 on calling this a bug fix, if you can add a whatsnew note and ping on green.

@jreback jreback added Dtype Conversions Unexpected or buggy dtype conversions Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Mar 1, 2021
@jreback jreback added this to the 1.3 milestone Mar 1, 2021
@jbrockmendel
Copy link
Member Author

whatsnew added + greenish

@jreback jreback merged commit cbbaf20 into pandas-dev:master Mar 1, 2021
@jbrockmendel jbrockmendel deleted the typ-construction branch March 1, 2021 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants