forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: allow concat of Styler objects (pandas-dev#46105)
- Loading branch information
Showing
11 changed files
with
217 additions
and
17 deletions.
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 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 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 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 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 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 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 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 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 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