-
-
Notifications
You must be signed in to change notification settings - Fork 143
Add stub for Styler.map_index #905
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
Changes from 2 commits
b1c98fe
af3c09c
fc0d75f
8700140
49d9b5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,18 @@ def f1(s: Series) -> Series[str]: | |
check(assert_type(DF.style.apply_index(f1), Styler), Styler) | ||
|
||
|
||
def test_map_index() -> None: | ||
def f(s: Series) -> npt.NDArray[np.str_]: | ||
return np.asarray(s, dtype=np.str_) | ||
|
||
check(assert_type(DF.style.map_index(f), Styler), Styler) | ||
|
||
def f1(s: Series) -> Series[str]: | ||
return Series(s, dtype=str) | ||
|
||
check(assert_type(DF.style.map_index(f1), Styler), Styler) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The tests should be modified to something similar to what you see in the docs for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated to show the first example from the docs. The second one showed the following error
|
||
|
||
|
||
def test_background_gradient() -> None: | ||
check(assert_type(DF.style.background_gradient(), Styler), Styler) | ||
|
||
|
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.
Based on the docs, I think this should be
Callable[[Scalar], 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.
Thanks, I updated to
Callable[[Scalar], str | None]
to match the docs