-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
ENH: allow concat of Styler objects #46105
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
Merged
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
4cfb671
skeleton
attack68 ba3d421
html template
attack68 2f36cef
test internals
attack68 3927adc
additional tests
attack68 8d6dabc
additional tests
attack68 56262b8
additional tests
attack68 aeeca3b
additional tests
attack68 f8cf8af
additional tests
attack68 7703343
additional tests
attack68 5d70293
errors testing
attack68 6811f4b
errors testing
attack68 409fad2
doc edits
attack68 d516b2f
LaTeX footer
attack68 6890e56
to_string mods, and tests
attack68 7281a9c
doc edits
attack68 e6fbf53
valueerror test
attack68 88db947
REMOVE CUSTOM FORMATTING
attack68 8c8ae96
doc edits
attack68 5511e80
doc edits
attack68 5400614
test moved
attack68 28bc86b
Merge remote-tracking branch 'upstream/main' into styler_footer
attack68 f158eeb
concatenate instead
attack68 bf06ce1
removing redundant code
attack68 af287e2
removing redundant code
attack68 aa02e86
removing redundant code
attack68 0ae6b53
removing redundant code
attack68 7ebddd0
removing redundant code
attack68 5a7ccc7
doc edits
attack68 bba6077
doc edits
attack68 1032336
doc edits
attack68 394b9e0
edit tests
attack68 cf42933
edit tests
attack68 dfcdf6b
general render method
attack68 64cf7bc
doc warnings
attack68 ad23748
doc warnings
attack68 f92c54c
revert merge
attack68 5aeb8b8
html test
attack68 1417e7e
Merge remote-tracking branch 'upstream/main' into styler_footer
attack68 70184fa
doc test fix
attack68 0c107d2
edit docs
attack68 3b1cac3
Merge remote-tracking branch 'upstream/main' into styler_footer
attack68 5b44e92
fix typing
attack68 a21beef
reorder calculation for recursion
attack68 5debdf6
allow working chained multiple concatenation
attack68 eccf6db
fix test with chaining
attack68 e2a1bbd
Merge remote-tracking branch 'upstream/main' into styler_footer
attack68 f2701a2
mypy fix
attack68 534d5c0
mypy fix
attack68 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import pytest | ||
|
||
jinja2 = pytest.importorskip("jinja2") | ||
|
||
from pandas import DataFrame | ||
|
||
from pandas.io.formats.style import Styler | ||
|
||
|
||
@pytest.fixture | ||
def df(): | ||
return DataFrame( | ||
data=[[0, -0.609], [1, -1.228]], | ||
columns=["A", "B"], | ||
index=["x", "y"], | ||
) | ||
|
||
|
||
@pytest.fixture | ||
def styler(df): | ||
return Styler(df, uuid_len=0) | ||
|
||
|
||
def test_concat_bad_columns(styler): | ||
msg = "`other.data` must have same columns as `Styler.data" | ||
with pytest.raises(ValueError, match=msg): | ||
styler.concat(DataFrame([[1, 2]]).style) | ||
|
||
|
||
def test_concat_bad_type(styler): | ||
msg = "`other` must be of type `Styler`" | ||
with pytest.raises(TypeError, match=msg): | ||
styler.concat(DataFrame([[1, 2]])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.