-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
(fix): don't handle time-dtypes as extension arrays in from_dataframe
#9042
Merged
Conversation
This file contains 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
Aloqeely
reviewed
May 24, 2024
@dcherian could you review? |
dcherian
reviewed
Jun 11, 2024
dcherian
added a commit
to dcherian/xarray
that referenced
this pull request
Jun 13, 2024
* upstream/main: [skip-ci] Try fixing hypothesis CI trigger (pydata#9112) Undo custom padding-top. (pydata#9107) add remaining core-dev citations [skip-ci][skip-rtd] (pydata#9110) Add user survey announcement to docs (pydata#9101) skip the `pandas` datetime roundtrip test with `pandas=3.0` (pydata#9104) Adds Matt Savoie to CITATION.cff (pydata#9103) [skip-ci] Fix skip-ci for hypothesis (pydata#9102) open_datatree performance improvement on NetCDF, H5, and Zarr files (pydata#9014) Migrate datatree io.py and common.py into xarray/core (pydata#9011) Micro optimizations to improve indexing (pydata#9002) (fix): don't handle time-dtypes as extension arrays in `from_dataframe` (pydata#9042)
andersy005
pushed a commit
that referenced
this pull request
Jun 14, 2024
…e` (#9042) * (fix): don't handle time-dtypes as extension arrays * (fix): check series type * Add whats-new --------- Co-authored-by: Deepak Cherian <deepak@cherian.net> Co-authored-by: Deepak Cherian <dcherian@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is probably the simplest way to fix the bug but I now have many questions about
PandasIndexingAdapter
. I initially attempted to make datetime dtypes go intoExtensionArray
(because they are extension arrays) but there are so many tests with behavior that I don't understand that this seemed easier. Primarily, my issue with doing that wasn't that the tests broke in a way that was "this behavior doesn't make sense" but rather "this behavior makes more sense than what the test expects" i.e., there were a number of places where tests expect datetime dtypes to not be preserved, but they are preserved by usingExtensionArray
. But I don't understand why certain things are expected or not. For example:xarray/xarray/tests/test_variable.py
Lines 2967 to 2968 in 026aa7c
became a condition that expected the
dtype
be preserved and not just blanket converting everything tonp.dtype("datetime64[ns]")
i.e., thedtype
onvar
remainedpd.DatetimeTZDtype("s", pytz.timezone("America/New_York"))
whats-new.rst
api.rst