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-#7051: Update exception message for astype function #7052

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

anmyachev
Copy link
Collaborator

@anmyachev anmyachev commented Mar 11, 2024

What do these changes do?

Part of #6954

  • 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 Update Exception message for astype function in the case of duplicated values #7051
  • tests added and passing
  • module layout described at docs/development/architecture.rst is up-to-date

Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
@@ -900,10 +900,18 @@ def execute_callable(fn, inplace=False, md_kwargs={}, pd_kwargs={}):
), "Got Modin Exception type {}, but pandas Exception type {} was expected".format(
type(md_e), type(pd_e)
)
if raising_exceptions:
if raising_exceptions and isinstance(raising_exceptions, (list, tuple)):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This code branch is temporary and will be removed in #6954.

Copy link
Collaborator

Choose a reason for hiding this comment

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

How will this complicate further development until #6954 is merged?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In general, it shouldn’t complicate things in any way, since this parameter is still optional.

assert not isinstance(
md_e, tuple(raising_exceptions)
), f"not acceptable exception type: {md_e}"
elif raising_exceptions and type(raising_exceptions) is type:
Copy link
Collaborator Author

@anmyachev anmyachev Mar 11, 2024

Choose a reason for hiding this comment

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

type(raising_exceptions) is type: - сhecking to ensure that it is not the class that is being passed, but its instance

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't quite get this. Could you provide an example of passing such an instance?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

>>> type(TypeError) is type
True
>>> type(TypeError("something")) is type 
False

@anmyachev anmyachev marked this pull request as ready for review March 11, 2024 20:21
@anmyachev
Copy link
Collaborator Author

anmyachev commented Mar 11, 2024

@YarShev please take a look

I still decided to divide it into parts to simplify the review.

@YarShev YarShev merged commit 4ab68c6 into modin-project:master Mar 12, 2024
37 checks passed
@anmyachev anmyachev deleted the issue7051 branch March 12, 2024 09:45
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.

Update Exception message for astype function in the case of duplicated values
2 participants