-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: styler.format options and validator tests #43341
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
Conversation
(cherry picked from commit 9981172)
…tions # Conflicts: # pandas/core/config_init.py
…tions # Conflicts: # pandas/core/config_init.py
cool, once more rebase pls. |
…tions # Conflicts: # pandas/tests/io/formats/style/test_format.py
grr frequent network issues calling the conda repos hopefully #42580 helps with this.
|
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
LGTM
@@ -851,7 +857,7 @@ def register_converter_cb(key): | |||
"format.formatter", | |||
None, | |||
styler_formatter, | |||
validator=is_instance_factory([type(None), dict, callable, str]), |
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.
umm why doesn't this work?
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.
x = '{:.2f}'
def inner(x) -> None:
> if not isinstance(x, _type):
E TypeError: isinstance() arg 2 must be a type or tuple of types
x = <function <lambda> at 0x1251dd160>
def inner(x) -> None:
> if not isinstance(x, _type):
E TypeError: isinstance() arg 2 must be a type or tuple of types
Also the signature of of the is_instance_factory
struggles with callable:
>>> isinstance(lambda x: x, callable)
False
>>> isinstance(lambda x: x, type(callable))
False
>>> callable(lambda x: x)
True
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.
Ok fixed: callable != Callable
!!!
…tions # Conflicts: # pandas/tests/io/formats/style/test_format.py
sorry, this is a fix for recent #43256.
the input types were not working using the instance factory approach so this is explicit.