-
Notifications
You must be signed in to change notification settings - Fork 653
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
Conversation
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)): |
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.
This code branch is temporary and will be removed in #6954.
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.
How will this complicate further development until #6954 is merged?
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.
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: |
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.
type(raising_exceptions) is type:
- сhecking to ensure that it is not the class that is being passed, but its instance
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.
I don't quite get this. Could you provide an example of passing such an instance?
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.
>>> type(TypeError) is type
True
>>> type(TypeError("something")) is type
False
@YarShev please take a look I still decided to divide it into parts to simplify the review. |
What do these changes do?
Part of #6954
flake8 modin/ asv_bench/benchmarks scripts/doc_checker.py
black --check modin/ asv_bench/benchmarks scripts/doc_checker.py
git commit -s
astype
function in the case of duplicated values #7051docs/development/architecture.rst
is up-to-date