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

Make DTI[tz]._values and Series[tz]._values return DTA #24534

Merged
merged 4 commits into from
Jan 1, 2019

Conversation

jbrockmendel
Copy link
Member

broken off of #24024, cc @jreback @TomAugspurger

I think the edits in core.dtypes.concat are unrelated, but they are correct regardless and easy to trim a few more lines off the diff.

The edit in tests.indexing.test_coercion was needed during troubleshooting, decided to keep it.

@jreback jreback added the Datetime Datetime data dtype label Jan 1, 2019
@jreback jreback added this to the 0.24.0 milestone Jan 1, 2019
@jreback
Copy link
Contributor

jreback commented Jan 1, 2019

lgtm.

@codecov
Copy link

codecov bot commented Jan 1, 2019

Codecov Report

Merging #24534 into master will increase coverage by <.01%.
The diff coverage is 44.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #24534      +/-   ##
==========================================
+ Coverage   31.88%   31.88%   +<.01%     
==========================================
  Files         166      166              
  Lines       52427    52436       +9     
==========================================
+ Hits        16714    16721       +7     
- Misses      35713    35715       +2
Flag Coverage Δ
#multiple 30.3% <44.44%> (+0.02%) ⬆️
#single 31.88% <44.44%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/dtypes/concat.py 29.9% <0%> (ø) ⬆️
pandas/core/series.py 38.25% <100%> (+0.16%) ⬆️
pandas/core/indexes/datetimes.py 36.75% <28.57%> (-0.2%) ⬇️
pandas/core/internals/blocks.py 38.04% <40%> (-0.06%) ⬇️
pandas/core/internals/managers.py 57.57% <0%> (+0.2%) ⬆️
pandas/core/arrays/datetimes.py 62.62% <0%> (+0.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 091cfbb...9bcaf77. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Jan 1, 2019

Codecov Report

Merging #24534 into master will increase coverage by <.01%.
The diff coverage is 44.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #24534      +/-   ##
==========================================
+ Coverage   31.88%   31.88%   +<.01%     
==========================================
  Files         166      166              
  Lines       52427    52436       +9     
==========================================
+ Hits        16714    16721       +7     
- Misses      35713    35715       +2
Flag Coverage Δ
#multiple 30.3% <44.44%> (+0.02%) ⬆️
#single 31.88% <44.44%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/dtypes/concat.py 29.9% <0%> (ø) ⬆️
pandas/core/series.py 38.25% <100%> (+0.16%) ⬆️
pandas/core/indexes/datetimes.py 36.75% <28.57%> (-0.2%) ⬇️
pandas/core/internals/blocks.py 38.04% <40%> (-0.06%) ⬇️
pandas/core/internals/managers.py 57.57% <0%> (+0.2%) ⬆️
pandas/core/arrays/datetimes.py 62.62% <0%> (+0.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 091cfbb...9bcaf77. Read the comment docs.

@jbrockmendel
Copy link
Member Author

gentle ping

@jreback jreback merged commit 945445d into pandas-dev:master Jan 1, 2019
@jreback
Copy link
Contributor

jreback commented Jan 1, 2019

thanks @jbrockmendel

@@ -340,7 +346,7 @@ def _values(self):
# tz-naive -> ndarray
# tz-aware -> DatetimeIndex
if self.tz is not None:
return self
return self._eadata
Copy link
Contributor

Choose a reason for hiding this comment

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

This change is obsolete in #24024 since we always return a DatetimeArray.

thoo added a commit to thoo/pandas that referenced this pull request Jan 1, 2019
* upstream/master:
  Make DTI[tz]._values and Series[tz]._values return DTA (pandas-dev#24534)
  CLN: Refactor some sorting code in Index set operations (pandas-dev#24533)
  Run isort (pandas-dev#24530)
  CI: fix db usage in CI (pandas-dev#24529)
@@ -316,6 +316,12 @@ def _simple_new(cls, values, name=None, freq=None, tz=None, dtype=None):
we require the we have a dtype compat for the values
if we are passed a non-dtype compat, then coerce using the constructor
"""
if isinstance(values, DatetimeArray):
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have anywhere that passes a DatetimeArray here and additional keyword arguments?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm pretty sure we do. I'll double-check and post

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. At the very least two tests in test_multilevel

@jbrockmendel jbrockmendel deleted the values branch January 1, 2019 21:20
result = self._data.internal_values()
if isinstance(result, DatetimeIndex):
result = result._eadata
return result
Copy link
Member Author

Choose a reason for hiding this comment

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

this should also be removeable in 24024

Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants