-
-
Notifications
You must be signed in to change notification settings - Fork 146
GH1147 Drop version restriction on matplotlib and prevent test to write to root folder #1148
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 1 commit
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 |
---|---|---|
|
@@ -43,7 +43,7 @@ pyright = ">=1.1.396" | |
poethepoet = ">=0.16.5" | ||
loguru = ">=0.6.0" | ||
typing-extensions = ">=4.4.0" | ||
matplotlib = ">=3.5.1,<3.9.0" # TODO https://github.com/pandas-dev/pandas/issues/58851 | ||
matplotlib = ">=3.5.10" # TODO https://github.com/pandas-dev/pandas/issues/58851 | ||
pre-commit = ">=2.19.0" | ||
black = ">=23.3.0" | ||
isort = ">=5.12.0" | ||
|
@@ -231,7 +231,7 @@ filterwarnings = [ | |
# treat warnings as errors | ||
"error", | ||
# until there is a new dateutil release: github.com/dateutil/dateutil/pull/1285 | ||
"ignore:datetime.datetime.utc:DeprecationWarning", | ||
# "ignore:datetime.datetime.utc:DeprecationWarning", | ||
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. If commenting this out works, you can just remove this line and the line above 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. I tried for testing since that is still a draft PR but indeed will delete. |
||
] | ||
|
||
# Next line needed to avoid poetry complaint | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -575,7 +575,10 @@ def test_plot_keywords(close_figures): | |
|
||
df = pd.DataFrame(np.random.rand(10, 5), columns=["A", "B", "C", "D", "E"]) | ||
check( | ||
assert_type(df.plot(kind="box", vert=False, positions=[1, 4, 5, 6, 8]), Axes), | ||
assert_type( | ||
df.plot(kind="box", orientation="vertical", positions=[1, 4, 5, 6, 8]), | ||
Axes, | ||
), | ||
Axes, | ||
) | ||
|
||
|
@@ -603,15 +606,19 @@ def test_grouped_dataframe_boxplot(close_figures): | |
check(assert_type(grouped.boxplot(subplots=True), Series), Series) | ||
|
||
# a single plot | ||
check( | ||
assert_type( | ||
grouped.boxplot( | ||
subplots=False, rot=45, fontsize=12, figsize=(8, 10), vert=False | ||
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. Switching this to 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. error in pytest or in typing? If pytest, then if you can reproduce by just using pandas, then report a pandas issue. 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. It is a runtime error, if you try and run the code it will throw an error. 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. This seems a pandas bug, I am going to do a little bit of investigation, it happens because the orientation parameter is not passed properly. 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. I dug into it and I was not able to reproduce it on the main branch of pandas. 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. So you could keep the test in there and surround it with 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. Actually that would not work since the issue was how pandas passed the information to matplotlib (and we upgraded matplotlib version) and we don't have a test of the matplotlib version if I am correct. 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 test was originally failing because of the matplotlib version that was upgraded and then it was how pandas supplied the kwargs to matplotlib. 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. Yes, so in the current form, with the upgraded So you could surround your desired test that includes 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. Sorry I completely missed your point. This is addressed. I kept the split test and added for both a check on |
||
), | ||
Axes, | ||
), | ||
Axes, | ||
) | ||
# check( | ||
# assert_type( | ||
# grouped.boxplot( | ||
# subplots=False, | ||
# rot=45, | ||
# fontsize=12, | ||
# figsize=(8, 10), | ||
# orientation="horizontal", | ||
# ), | ||
# Axes, | ||
# ), | ||
# Axes, | ||
# ) | ||
|
||
# not a literal bool | ||
check(assert_type(grouped.boxplot(subplots=bool(0.5)), Union[Axes, Series]), Series) | ||
|
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.
pandas now requires 3.6.3, so can update this constraint to that version, and remove the comment since that issue is now closed
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 will adjust this is a good point.