Skip to content

Commit 58b99c6

Browse files
committed
Dependencies: Add compatibility with pandas 2
1 parent 46bfcb0 commit 58b99c6

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

CHANGES.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ development
1212
- CI: Add GHA configuration to invoke software tests
1313
- CI/Tests: Fix installation on Python 3.7 to 3.9
1414
- Dependencies: Switch from ``appdirs`` to ``platformdirs``
15-
- Dependencies: Update to ``pandas<2`
15+
- Dependencies: Add compatibility with pandas 2
1616
- Docs: Add `examples` snippets to README and tests
1717
- Tests: Add code snippet in README to test suite, per doctest
1818
- Docs: Add configuration for "Read the Docs"

phenodata/dwd/cdc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ def csv_to_dataframe(self, stream, index_column=None, coerce_int=False):
102102
# return
103103

104104
# Read CSV into pandas DataFrame.
105-
# https://pandas.pydata.org/pandas-docs/stable/io.html
105+
# https://pandas.pydata.org/pandas-docs/stable/user_guide/io.html#csv-text-files
106106
df = pd.read_csv(
107107
stream, engine='c', encoding='utf-8',
108108
delimiter=';', skipinitialspace=True,
109109
skip_blank_lines=True,
110-
error_bad_lines=False,
110+
on_bad_lines="warn",
111111
low_memory=False
112112
)
113113

phenodata/dwd/pheno.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def query(self, partition=None, files=None):
288288
# Coerce "Eintrittsdatum" column into date format
289289
data['Eintrittsdatum'] = pd.to_datetime(data['Eintrittsdatum'], errors='coerce', format='%Y%m%d')
290290

291-
results = results.append(data, sort=False)
291+
results = pd.concat([results, data], sort=False)
292292

293293
# Sanity checks
294294
if results.empty:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
'docopt>=0.6.2',
1212
'dogpile.cache>=0.6.5,<1', # Verified to work on 1.1.1.
1313
'future',
14-
'pandas>=0.23.4,<2',
14+
'pandas>=0.23.4,<2.1',
1515
'platformdirs<4',
1616
'requests>=2.18.4,<3',
1717
'requests-ftp>=0.3.1,<4', # Verified to work on 0.3.1.

tests/test_examples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def test_example_stations(capfd):
66
os.system(f"{sys.executable} examples/stations.py")
77

88
out, err = capfd.readouterr()
9-
assert "Int64Index: 323 entries" in out
9+
assert "Index: 323 entries" in out
1010
assert "Data columns (total 10 columns)" in out
1111
assert "Stationsname" in out
1212
assert "[323 rows x 10 columns]" in out
@@ -16,6 +16,6 @@ def test_example_observations(capfd):
1616
os.system(f"{sys.executable} examples/observations.py")
1717

1818
out, err = capfd.readouterr()
19-
assert "Int64Index: 6 entries" in out
19+
assert "Index: 6 entries" in out
2020
assert "Data columns (total 8 columns)" in out
2121
assert "Stations_id" in out

0 commit comments

Comments
 (0)