Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

impl loc callable #501

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

impl loc callable #501

wants to merge 5 commits into from

Conversation

1e-to
Copy link
Contributor

@1e-to 1e-to commented Jan 15, 2020

No description provided.

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.\
Copy link
Contributor

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.

@skip_sdc_jit('Not impl in old style')
def test_series_loc_callable(self):
def test_impl(S):
return S.loc[(lambda a: a)]
Copy link
Contributor

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?

Copy link
Contributor

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?

@skip_sdc_jit('Not impl in old style')
def test_series_loc_callable(self):
def test_impl(S):
return S.loc[(lambda a: a)]
Copy link
Contributor

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):
Copy link
Contributor

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not do that?

Copy link
Contributor Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants