Skip to content

Avoid pandas resample crash in Windows Python 3.12 forecast tests#1566

Merged
thinkall merged 2 commits into
mainfrom
copilot/fix-github-actions-job-failure
Jul 3, 2026
Merged

Avoid pandas resample crash in Windows Python 3.12 forecast tests#1566
thinkall merged 2 commits into
mainfrom
copilot/fix-github-actions-job-failure

Conversation

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

The build (windows-latest, 3.12) job was failing with a fatal access violation during forecast test setup. The crash came from pandas daily resampling in shared test dataset preprocessing.

  • Root cause

    • Forecast test fixtures in test_extra_models.py and test_forecast.py normalized hourly data with:
      df = df.set_index("timeStamp")
      df = df.resample("D").mean()
    • On Windows + Python 3.12, that resample path crashes inside pandas.
  • Change

    • Replace resample-based daily aggregation with explicit day bucketing plus grouped mean:
      df["timeStamp"] = pd.to_datetime(df["timeStamp"]).dt.floor("D")
      df = df.groupby("timeStamp", as_index=False).mean(numeric_only=True)
    • Keep the rest of the fixture behavior unchanged (ffill, trailing NaN row removal).
  • Coverage

    • Add a focused regression test in test_extra_models.py that patches pandas.read_csv and verifies the helper still produces the expected daily aggregates without using resample.
  • Effect

    • Preserves test intent and dataset shape while avoiding the Windows-specific pandas crash path in the failing job.

Copilot AI changed the title [WIP] Fix failing GitHub Actions job 'build (windows-latest, 3.12)' Avoid pandas resample crash in Windows Python 3.12 forecast tests Jul 1, 2026
Copilot AI requested a review from thinkall July 1, 2026 02:03
@thinkall
thinkall marked this pull request as ready for review July 3, 2026 08:48
@thinkall
thinkall merged commit c489c5e into main Jul 3, 2026
24 of 25 checks passed
@thinkall
thinkall deleted the copilot/fix-github-actions-job-failure branch July 3, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants