Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Pandas 0.25 breaks tests #14859

Copy link
Copy link
Closed
Closed
Copy link
@jklymak

Description

@jklymak
Issue body actions

@jklymak Thanks! And yes, it's the pandas 0.25.0 that causes the failure, 0.24.2 was fine.

Can we change the test_bar_pandas(pd) to following to avoid this failure?

def test_bar_pandas(pd):
    # Smoke test for pandas
    pd.plotting.register_matplotlib_converters()
    fig, ax = plt.subplots()

    df = pd.DataFrame(
        {'year': [2018, 2018, 2018],
         'month': [1, 1, 1],
         'day': [1, 2, 3],
         'value': [1, 2, 3]})
    df['date'] = pd.to_datetime(df[['year', 'month', 'day']])

    monthly = df[['date', 'value']].groupby(['date']).sum()
    dates = monthly.index
    forecast = monthly['value']
    baseline = monthly['value']
    ax.bar(dates, forecast, width=10, align='center')
    ax.plot(dates, baseline, color='orange', lw=4)
    pd.plotting.deregister_matplotlib_converters()

i.e. register at beginning and deregister at the end.

Originally posted by @bingyao in #14739 (comment)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.