fix: pandas 3.0 compatibility (frequency alias migration) - #6
Merged
Merged
Conversation
pandas 3.0 removed the deprecated single-letter offset aliases, which
broke the financial-analysis and data-processing code paths (26 errors
in the Flask simulation integration tests on a fresh install, since
pip resolves pandas to 3.x with no upper bound).
Replace the removed aliases with their 2.2+ equivalents:
- freq="T" -> freq="min" (8 date_range call sites)
- resample("M") / "M" period literals -> "ME"
- freq="H" / resample("1H") -> "h" / "1h"
Bump the pandas floor to >=2.2 in pyproject.toml and setup.py, since
the "min"/"ME"/"h" aliases require pandas 2.2+. Also add venv/ and
.venv/ to .gitignore so a locally-created virtualenv is not tracked.
Full fast test suite: 1503 passed, 2 xfailed (was 1477 passed + 26
errored before the fix).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mendesfabio
approved these changes
Jul 10, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On a fresh clone +
pip install -e ".[dev]", the dependency resolver installs pandas 3.0 (thepandasfloor was>=1.3.6with no upper bound). pandas 3.0 removed the long-deprecated single-letter offset aliases, which breaks the financial-analysis and data-processing code paths.Symptom: 26 errors in
tests/integration/test_flask_run_simulation.py, e.g.:Fix
Migrate the removed aliases to their pandas-2.2+ equivalents:
freq="T"freq="min"pd.date_rangecall sitesresample("M")/"M"period literals"ME"financial_analysis_functions.pyfreq="H"/resample("1H")"h"/"1h"historic_data_utils.py"D"and"W"are unchanged (still valid in pandas 3.0). The new aliases require pandas ≥2.2, so thepandasfloor is bumped to>=2.2in bothpyproject.tomlandsetup.py.Also adds
venv/and.venv/to.gitignore(an in-repo virtualenv was otherwise showing up as untracked).Testing
Fast suite (
pytest -m "not slow"):The 26 previously-failing Flask integration tests now pass.