COMPAT: extension dtypes (DatetimeTZ, Categorical) are now Singleton cached objects by jreback · Pull Request #13285 · pandas-dev/pandas (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation1 Commits1 Checks0 Files changed
Conversation
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
[ Show hidden characters]({{ revealButtonHref }})
allows for proper is / == comparisons
Had this odd semantic difference as these were really different objects (though they DID hash the same)
This doesn't actually affect any user code.
In [1]: from pandas.core import common as com
In [2]: t1 = com.DatetimeTZDtype('datetime64[ns, US/Eastern]')
In [3]: t2 = com.DatetimeTZDtype('datetime64[ns, US/Eastern]')
In [4]: t1 == t2
Out[4]: True
In [5]: t1 is t2
Out[5]: False
In [6]: hash(t1)
Out[6]: 5756291921003024619
In [7]: hash(t2)
Out[7]: 5756291921003024619
pandas objects compatability with Numpy or Python functions
labels
…cached objects
allows for proper is / == comparisons
Current coverage is 84.20%
@@ master #13285 diff @@
Files 138 138
Lines 50591 50607 +16
Methods 0 0
Messages 0 0
Branches 0 0
- Hits 42592 42613 +21
- Misses 7999 7994 -5
Partials 0 0
Powered by Codecov. Last updated by 8749273...fd09c61
Labels
pandas objects compatability with Numpy or Python functions
2 participants