Skip to content

Commit

Permalink
Merge pull request #235 from openscm/dependabot/pip/pandas-gte-1.1-an…
Browse files Browse the repository at this point in the history
…d-lt-3

Update pandas requirement from <2,>=1.1 to >=1.1,<3
  • Loading branch information
znicholls authored Oct 12, 2023
2 parents d323b81 + 97c3f17 commit 51b687c
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 8 deletions.
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

0 comments on commit 51b687c

Please sign in to comment.