Skip to content
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

FIX-#6651: make sure Series.between works correctly #6656

Merged
merged 2 commits into from
Oct 17, 2023

Conversation

anmyachev
Copy link
Collaborator

@anmyachev anmyachev commented Oct 16, 2023

What do these changes do?

  • first commit message and PR title follow format outlined here

    NOTE: If you edit the PR title to match this format, you need to add another commit (even if it's empty) or amend your last commit for the CI job that checks the PR title to pick up the new PR title.

  • passes flake8 modin/ asv_bench/benchmarks scripts/doc_checker.py
  • passes black --check modin/ asv_bench/benchmarks scripts/doc_checker.py
  • signed commit with git commit -s
  • Resolves AttributeError: 'PandasQueryCompiler' object has no attribute 'between' #6651
  • tests added and passing
  • module layout described at docs/development/architecture.rst is up-to-date

@anmyachev anmyachev marked this pull request as ready for review October 16, 2023 23:00
@anmyachev anmyachev requested a review from a team as a code owner October 16, 2023 23:00
Comment on lines 721 to 725
return self.__constructor__(
query_compiler=self._query_compiler.between(left, right, inclusive)
query_compiler=self._query_compiler.between(
left=left, right=right, inclusive=inclusive
)
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

it looks like the logic of this method can be easily implemented at the front end, I believe we don't need to add this new qc method.

We can either copy the pandas' logic or just pass our own object to the pandas method:

def between(self, left, right, inclusive):
    # 'pandas.between()' only uses public Series' API, so passing a Modin Series there is safe
    return pandas.Series.between(self, left, right, inclusive)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Interesting! Let's try.

Signed-off-by: Anatoly Myachev <[email protected]>
Co-authored-by: Dmitry Chigarev <[email protected]>
@anmyachev
Copy link
Collaborator Author

@dchigarev let's merge

@dchigarev dchigarev merged commit 21518c4 into modin-project:master Oct 17, 2023
36 checks passed
@anmyachev anmyachev deleted the issue6651 branch October 17, 2023 14:37
)
# 'pandas.Series.between()' only uses public Series' API,
# so passing a Modin Series there is safe
return pandas.Series.between(self, left, right, inclusive)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wouldn't rely on pandas to handle Modin objects properly. We should probably pass a pandas Series or a numpy array in to the method.

anmyachev added a commit to anmyachev/modin that referenced this pull request Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AttributeError: 'PandasQueryCompiler' object has no attribute 'between'
3 participants