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

Update pandas requirement from <2,>=1.1 to >=1.1,<3 #235

Merged
merged 3 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ jobs:
poetry run pytest -r a -v src tests

test-no-plotting:
# seaborn imports scipy which can make it available without being explicit.
# This test makes sure that everything works even if the plotting
# dependencies aren't installed.
runs-on: ubuntu-latest
Expand All @@ -121,7 +120,7 @@ jobs:
with:
python-version: "${{ matrix.python-version }}"
venv-id: "tests-${{ runner.os }}"
poetry-dependency-install-flags: "--all-extras --only 'tests'"
poetry-dependency-install-flags: "--extras optional --with tests"
- name: Test with pytest
run: |
poetry run pytest -r a -v src tests
Expand Down
3 changes: 3 additions & 0 deletions changelog/235.improvement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Added support for pandas>=2

Requirement now set to 'pandas>=1.1'
3 changes: 3 additions & 0 deletions changelog/235.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fixed broken CI of no plotting test

Fixes a regression when translating the old no plotting test to the new poetry CI setup in [#260](https://github.com/openscm/scmdata/pull/260)
3 changes: 1 addition & 2 deletions docs/source/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ of rst and use slightly different categories.

<!-- towncrier release notes start -->

v0.15.2
-------
## v0.15.2

- ([#257](https://github.com/openscm/scmdata/pull/257)) Updated to support the latest version of {mod}`notebook`
- ([#252](https://github.com/openscm/scmdata/pull/252)) Add ``py.typed`` file do downstream packages can use
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ cftime = ">=1.5"
numpy = "*"
openscm-units = "*"
packaging = "*"
pandas = ">=1.1, <2"
pandas = ">=1.1"
pint = "<0.20"
pint-pandas = "*"
python-dateutil = "*"
Expand Down
16 changes: 13 additions & 3 deletions tests/unit/test_pyam_compat.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import re
from unittest import mock

import pandas as pd
import pytest

from scmdata.pyam_compat import LongDatetimeIamDataFrame
Expand All @@ -13,9 +14,18 @@ def test_to_int_value_error(test_iam_df):
postion = 4
idf.loc[postion, "time"] = bad_val

error_msg = re.escape(
f"Unknown string format: {bad_val} present at position {postion}"
)
if pd.__version__.startswith("1"):
error_msg = re.escape(
f"Unknown string format: {bad_val} present at position {postion}"
)

else:
error_msg = re.escape(
f'time data "{bad_val}" '
"doesn't match format "
'"%Y/%m/%d", at position 4. You might want to try:'
)

with pytest.raises(ValueError, match=error_msg):
LongDatetimeIamDataFrame(idf)

Expand Down
Loading