Skip to content

REF/TYP: define methods non-dynamically for SparseArray #36943

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

Merged
merged 4 commits into from
Oct 10, 2020

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

fill_value = op(self.fill_value, other)
result = op(self.sp_values, other)
@unpack_zerodim_and_defer("__and__")
def __and__(self, other) -> "SparseArray":
Copy link
Member

Choose a reason for hiding this comment

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

with #36964 merged, can these now be removed?

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, updated

return compat.set_function_name(cmp_method, name, cls)
@unpack_zerodim_and_defer("__xor__")
def __xor__(self, other) -> "SparseArray":
return self._logical_method(other, operator.xor)
Copy link
Member

Choose a reason for hiding this comment

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

this was using _create_arithmetic_method b4 whereas and and or were using _create_comparison_method. Any user facing changes?

@@ -796,7 +795,6 @@ def __getitem__(self, key):
key = check_array_indexer(self, key)

if com.is_bool_indexer(key):
key = check_bool_indexer(self, key)
Copy link
Member

Choose a reason for hiding this comment

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

not needed?

@simonjayhawkins simonjayhawkins added Refactor Internal refactoring of code Typing type annotations, mypy/pyright type checking labels Oct 8, 2020
@simonjayhawkins simonjayhawkins added this to the 1.2 milestone Oct 8, 2020
@jreback jreback merged commit cf5d6a2 into pandas-dev:master Oct 10, 2020
@jbrockmendel jbrockmendel deleted the typ-arrays branch October 10, 2020 18:10
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Internal refactoring of code Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants