-
- Notifications
You must be signed in to change notification settings - Fork 19.4k
DF.__setitem__ creates extension column when given extension scalar #34875
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
Merged
Merged
Changes from 20 commits
Commits
Show all changes
42 commits Select commit Hold shift + click to select a range
0ec5911 Bugfix to make DF.__setitem__ create extension column instead of obje…
justinessert 9336955 removed bad whitespace
justinessert 01fb076 Apply suggestions from code review
justinessert 5c8b356 added missing :
justinessert 2c1f640 modified cast_extension_scalar_to_array test to include an Interval type
justinessert d509bf4 added user-facing test for extension type bug
justinessert e231bb1 fixed pep8 issues
justinessert 18ed043 added note about bug in setting series to scalar extension type
justinessert a6b18f4 corrected order of imports
justinessert cbc29be corrected order of imports
justinessert 2f79822 fixed black formatting errors
justinessert 0f9178e removed extra comma
justinessert bfa18fb updated cast_scalar_to_arr to support tuple shape for extension dtype
justinessert e7e9a48 removed unneeded code
justinessert 291eb2d added coverage for datetime with timezone in extension_array test
justinessert 3a788ed added TODO
justinessert 38d7ce5 correct line that was too long
justinessert a5e8df5 fixed dtype issue with tz test
justinessert 5e439bd creating distinct arrays for each column
justinessert 6cc7959 resolving mypy error
justinessert 7e27a6e added docstring info and test
justinessert 90a8570 removed unneeded import
justinessert 39b2984 flattened else case in init
justinessert 7a01041 refactored extension type column fix
justinessert 03e528b reverted docstring changes
justinessert 7bb9553 reverted docstring changes
justinessert a3be9a6 removed unneeded imports
justinessert 3a92164 reverted test changes
justinessert c93a847 fixed construct_1d_arraylike bug
justinessert 966283a reorganized if statements
justinessert f2aea7b moved what's new statement to correct file
justinessert 6495a36 created new test for period df construction
justinessert 42e7afa added assert_frame_equal to period_data test
justinessert 8343df3 Using pandas array instead of df constructor for better test
justinessert a50a42c changed wording
justinessert 3452c20 Merge branch 'master' of https://github.com/justinessert/pandas
justinessert 6f3fb51 pylint fixes
justinessert b95cdfc parameterized test and added comment
justinessert 6830fde removed extra comma
justinessert 6653ef8 Merge branch 'master' into master
justinessert c73a2de parameterized test
justinessert 100f334 renamed test
justinessert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
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.
since we had to change some other tests, I think we need to break this to a new section and show the changes from before. E.g. construction of a multi-column df now is object if we don't have unform datetimes? (we need to be very clear what is the change here since we had to change some tests)
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.
Realized that I added this to the wrong file, so I'm moving this addition to
v1.1.0.rst. But can you clarify what you would like me to do here? I'm not totally sure based on your comment.I think that this line correctly describes the change. Are you asking to also include an example, such as
The example you gave, where a datetime column has multiple different timezones, this was always an object column.
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.
ok tell you what. let's create an issue to refactor this (frame constructor). That's what I mainly have a problem with, we are adding if/then ALL over the place for extension types rather than a proper refactor.
So ok with merging this (just one small change on the naming in the tests). And please create an issue (and if you want / can refactor would be great) as a followup.