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

BUG: dtype lost in DataFrame.append #43392

Merged
merged 3 commits into from
Sep 4, 2021
Merged

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry
  1. For BlockManager, this improves dtype-retention, see test_append_same_columns_type
  2. For ArrayManager, this fixes an unwanted casting to object, see test_append_empty_frame_to_series_with_dateutil_tz
  3. I'm increasingly confident that with this, we can get rid of several kludges in internals.concat
  4. This does change the order of columns in some cases, see test_append_empty_frame_to_series_with_dateutil_tz. AFAICT this is due to a bug in union_indexes (but fixing it breaks other things that i need to run down), xref BUG: concat still sorts columns if they differ #43375

@jreback jreback added the Dtype Conversions Unexpected or buggy dtype conversions label Sep 4, 2021
@jreback jreback added this to the 1.4 milestone Sep 4, 2021
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like a minor change but is still user facing if you can add a note

)
# integer dtype is preserved for columns present in ser.index
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert_frame_equal compares these dtypes no? (i guess ok that you are being explicit as well)

@jbrockmendel
Copy link
Member Author

whatsnew added + green

@jreback jreback merged commit 8eb2425 into pandas-dev:master Sep 4, 2021
@jbrockmendel jbrockmendel deleted the bug-append branch September 4, 2021 18:17
feefladder pushed a commit to feefladder/pandas that referenced this pull request Sep 7, 2021
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants