-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Fixed construction / factorization of empty PA and IA #24599
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
Fixed construction / factorization of empty PA and IA #24599
Conversation
@@ -179,6 +179,9 @@ def _concat_same_type(cls, to_concat): | |||
|
|||
def _values_for_factorize(self): | |||
frozen = self._values_for_argsort() |
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.
really?, why is it 2d to begin with?
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.
I think because np.array([()])
is 2-D.
Codecov Report
@@ Coverage Diff @@
## master #24599 +/- ##
===========================================
- Coverage 92.38% 43.04% -49.35%
===========================================
Files 166 166
Lines 52478 52485 +7
===========================================
- Hits 48483 22593 -25890
- Misses 3995 29892 +25897
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #24599 +/- ##
==========================================
- Coverage 92.38% 92.38% -0.01%
==========================================
Files 166 166
Lines 52478 52485 +7
==========================================
+ Hits 48483 48489 +6
- Misses 3995 3996 +1
Continue to review full report at Codecov.
|
@@ -225,8 +225,7 @@ def test_sub_period(): | |||
def test_where_different_freq_raises(other): | |||
ser = pd.Series(period_array(['2000', '2001', '2002'], freq='D')) | |||
cond = np.array([True, False, True]) | |||
with pytest.raises(IncompatibleFrequency, | |||
match="Input has different freq=H"): | |||
with pytest.raises(IncompatibleFrequency, match="freq"): |
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.
Needed this change, as __setitem__
might raise when creating the PeriodArray from a PeriodArray with different freq now, with a slightly different error message.
We might want to change validate_dtype_freq
to use the error message from raise_on_incompatible
. I haven't looked closely.
thanks! |
Closes #23933