-
Notifications
You must be signed in to change notification settings - Fork 61
impl loc callable #501
base: master
Are you sure you want to change the base?
impl loc callable #501
Conversation
return new_series | ||
|
||
return hpat_pandas_series_loc_callable_impl | ||
|
||
raise TypingError('{} The index must be an Number, Slice, String, List, Array or a callable.\ |
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.
Looks like we need to remove the exception raising.
sdc/tests/test_series.py
Outdated
@skip_sdc_jit('Not impl in old style') | ||
def test_series_loc_callable(self): | ||
def test_impl(S): | ||
return S.loc[(lambda a: a)] |
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.
Do you exactly need round brackets around of lambda?
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.
Maybe to complicate lambda, e.g. a
-> a ** 2
?
sdc/tests/test_series.py
Outdated
@skip_sdc_jit('Not impl in old style') | ||
def test_series_loc_callable(self): | ||
def test_impl(S): | ||
return S.loc[(lambda a: a)] |
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.
Maybe to complicate lambda, e.g. a
-> a ** 2
?
pd.testing.assert_series_equal(hpat_func(S), test_impl(S)) | ||
|
||
@unittest.skip('Loc callable return float Series') | ||
def test_series_loc_callable2(self): |
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.
What do you think about merging of test_series_loc_callable
and test_series_loc_callable2
?
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.
Why not do that?
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.
Because implementation has limit and always return float Series. In that case pandas return int Series, and we return float Series. I wrote about it in notes in loc.
Test skips with expected failure
No description provided.