Skip to content
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

REGR: Bar plot axis timestamp to string conversion error #46413

Merged

Conversation

ivan-ngchakming
Copy link
Contributor

Added regression test to prevent bar plot from attempting to convert x-axis from string to timestamp due to previous plot's axis units.

Problematic example:

ax.xaxis.update_units(self.ax_index)

@mroeschke mroeschke added the Testing pandas testing functions or related to the test suite label Mar 18, 2022
@mroeschke mroeschke added this to the 1.5 milestone Mar 18, 2022
# GH 38736
# Ensure string x-axis from the second plot will not be converted to datetime
# due to axis data from first plot
DataFrame(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some sort of assertion to these calls instead of just being a smoke test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the _check_plot_works function to each plot.

I also want to assert the datatype of the axis of the plots (ie. datetime and string), but I am a bit lost on how I can achieve that.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. cc @mroeschke

@mroeschke mroeschke merged commit b14d62e into pandas-dev:main Mar 20, 2022
@mroeschke
Copy link
Member

Thanks @ivan-ngchakming

yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
…46413)

* test: bar plot axis conversion regr test

* test: added check plot works assertion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Change of behavior between 1.1.5 and 1.2.0 in plot functions
3 participants