Skip to content

Commit dc04d00

Browse files
Backport PR #54633 on branch 2.1.x (DEP: remove python-snappy and brotli as optional dependencies (no longer used)) (#54637)
Backport PR #54633: DEP: remove python-snappy and brotli as optional dependencies (no longer used) Co-authored-by: Joris Van den Bossche <[email protected]>
1 parent 72282be commit dc04d00

17 files changed

+4
-53
lines changed

ci/deps/actions-310.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ dependencies:
2727
- beautifulsoup4>=4.11.1
2828
- blosc>=1.21.0
2929
- bottleneck>=1.3.4
30-
- brotlipy>=0.7.0
3130
- fastparquet>=0.8.1
3231
- fsspec>=2022.05.0
3332
- html5lib>=1.1
@@ -47,7 +46,6 @@ dependencies:
4746
- pymysql>=1.0.2
4847
- pyreadstat>=1.1.5
4948
- pytables>=3.7.0
50-
- python-snappy>=0.6.1
5149
- pyxlsb>=1.0.9
5250
- s3fs>=2022.05.0
5351
- scipy>=1.8.1

ci/deps/actions-311-downstream_compat.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ dependencies:
2828
- beautifulsoup4>=4.11.1
2929
- blosc>=1.21.0
3030
- bottleneck>=1.3.4
31-
- brotlipy>=0.7.0
3231
- fastparquet>=0.8.1
3332
- fsspec>=2022.05.0
3433
- html5lib>=1.1
@@ -48,7 +47,6 @@ dependencies:
4847
- pymysql>=1.0.2
4948
- pyreadstat>=1.1.5
5049
- pytables>=3.7.0
51-
- python-snappy>=0.6.1
5250
- pyxlsb>=1.0.9
5351
- s3fs>=2022.05.0
5452
- scipy>=1.8.1

ci/deps/actions-311.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ dependencies:
2727
- beautifulsoup4>=4.11.1
2828
- blosc>=1.21.0
2929
- bottleneck>=1.3.4
30-
- brotlipy>=0.7.0
3130
- fastparquet>=0.8.1
3231
- fsspec>=2022.05.0
3332
- html5lib>=1.1
@@ -47,7 +46,6 @@ dependencies:
4746
- pymysql>=1.0.2
4847
- pyreadstat>=1.1.5
4948
# - pytables>=3.7.0, 3.8.0 is first version that supports 3.11
50-
- python-snappy>=0.6.1
5149
- pyxlsb>=1.0.9
5250
- s3fs>=2022.05.0
5351
- scipy>=1.8.1

ci/deps/actions-39-minimum_versions.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ dependencies:
2929
- beautifulsoup4=4.11.1
3030
- blosc=1.21.0
3131
- bottleneck=1.3.4
32-
- brotlipy=0.7.0
3332
- fastparquet=0.8.1
3433
- fsspec=2022.05.0
3534
- html5lib=1.1
@@ -49,7 +48,6 @@ dependencies:
4948
- pymysql=1.0.2
5049
- pyreadstat=1.1.5
5150
- pytables=3.7.0
52-
- python-snappy=0.6.1
5351
- pyxlsb=1.0.9
5452
- s3fs=2022.05.0
5553
- scipy=1.8.1

ci/deps/actions-39.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ dependencies:
2727
- beautifulsoup4>=4.11.1
2828
- blosc>=1.21.0
2929
- bottleneck>=1.3.4
30-
- brotlipy>=0.7.0
3130
- fastparquet>=0.8.1
3231
- fsspec>=2022.05.0
3332
- html5lib>=1.1
@@ -47,7 +46,6 @@ dependencies:
4746
- pymysql>=1.0.2
4847
- pyreadstat>=1.1.5
4948
- pytables>=3.7.0
50-
- python-snappy>=0.6.1
5149
- pyxlsb>=1.0.9
5250
- s3fs>=2022.05.0
5351
- scipy>=1.8.1

ci/deps/circle-310-arm64.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ dependencies:
2727
- beautifulsoup4>=4.11.1
2828
- blosc>=1.21.0
2929
- bottleneck>=1.3.4
30-
- brotlipy>=0.7.0
3130
- fastparquet>=0.8.1
3231
- fsspec>=2022.05.0
3332
- html5lib>=1.1
@@ -48,7 +47,6 @@ dependencies:
4847
- pymysql>=1.0.2
4948
# - pyreadstat>=1.1.5 not available on ARM
5049
- pytables>=3.7.0
51-
- python-snappy>=0.6.1
5250
- pyxlsb>=1.0.9
5351
- s3fs>=2022.05.0
5452
- scipy>=1.8.1

doc/source/getting_started/install.rst

-2
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,6 @@ Installable with ``pip install "pandas[compression]"``
412412
========================= ================== =============== =============================================================
413413
Dependency Minimum Version pip extra Notes
414414
========================= ================== =============== =============================================================
415-
brotli 0.7.0 compression Brotli compression
416-
python-snappy 0.6.1 compression Snappy compression
417415
Zstandard 0.17.0 compression Zstandard compression
418416
========================= ================== =============== =============================================================
419417

environment.yml

-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ dependencies:
2727
# optional dependencies
2828
- beautifulsoup4>=4.11.1
2929
- blosc
30-
- brotlipy>=0.7.0
3130
- bottleneck>=1.3.4
3231
- fastparquet>=0.8.1
3332
- fsspec>=2022.05.0
@@ -48,7 +47,6 @@ dependencies:
4847
- pymysql>=1.0.2
4948
- pyreadstat>=1.1.5
5049
- pytables>=3.7.0
51-
- python-snappy>=0.6.1
5250
- pyxlsb>=1.0.9
5351
- s3fs>=2022.05.0
5452
- scipy>=1.8.1

pandas/compat/_optional.py

-11
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"bs4": "4.11.1",
1919
"blosc": "1.21.0",
2020
"bottleneck": "1.3.4",
21-
"brotli": "0.7.0",
2221
"dataframe-api-compat": "0.1.7",
2322
"fastparquet": "0.8.1",
2423
"fsspec": "2022.05.0",
@@ -41,7 +40,6 @@
4140
"pyxlsb": "1.0.9",
4241
"s3fs": "2022.05.0",
4342
"scipy": "1.8.1",
44-
"snappy": "0.6.1",
4543
"sqlalchemy": "1.4.36",
4644
"tables": "3.7.0",
4745
"tabulate": "0.8.10",
@@ -60,12 +58,10 @@
6058
INSTALL_MAPPING = {
6159
"bs4": "beautifulsoup4",
6260
"bottleneck": "Bottleneck",
63-
"brotli": "brotlipy",
6461
"jinja2": "Jinja2",
6562
"lxml.etree": "lxml",
6663
"odf": "odfpy",
6764
"pandas_gbq": "pandas-gbq",
68-
"snappy": "python-snappy",
6965
"sqlalchemy": "SQLAlchemy",
7066
"tables": "pytables",
7167
}
@@ -75,13 +71,6 @@ def get_version(module: types.ModuleType) -> str:
7571
version = getattr(module, "__version__", None)
7672

7773
if version is None:
78-
if module.__name__ == "brotli":
79-
# brotli doesn't contain attributes to confirm it's version
80-
return ""
81-
if module.__name__ == "snappy":
82-
# snappy doesn't contain attributes to confirm it's version
83-
# See https://github.com/andrix/python-snappy/pull/119
84-
return ""
8574
raise ImportError(f"Can't determine version for {module.__name__}")
8675
if module.__name__ == "psycopg2":
8776
# psycopg2 appends " (dt dec pq3 ext lo64)" to it's version

pandas/core/frame.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -2909,10 +2909,7 @@ def to_parquet(
29092909
'pyarrow' is unavailable.
29102910
compression : str or None, default 'snappy'
29112911
Name of the compression to use. Use ``None`` for no compression.
2912-
The supported compression methods actually depend on which engine
2913-
is used. For 'pyarrow', 'snappy', 'gzip', 'brotli', 'lz4', 'zstd'
2914-
are all supported. For 'fastparquet', only 'gzip' and 'snappy' are
2915-
supported.
2912+
Supported options: 'snappy', 'gzip', 'brotli', 'lz4', 'zstd'.
29162913
index : bool, default None
29172914
If ``True``, include the dataframe's index(es) in the file output.
29182915
If ``False``, they will not be written to the file.

pandas/io/parquet.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -444,10 +444,7 @@ def to_parquet(
444444
if you wish to use its implementation.
445445
compression : {{'snappy', 'gzip', 'brotli', 'lz4', 'zstd', None}},
446446
default 'snappy'. Name of the compression to use. Use ``None``
447-
for no compression. The supported compression methods actually
448-
depend on which engine is used. For 'pyarrow', 'snappy', 'gzip',
449-
'brotli', 'lz4', 'zstd' are all supported. For 'fastparquet',
450-
only 'gzip' and 'snappy' are supported.
447+
for no compression.
451448
index : bool, default None
452449
If ``True``, include the dataframe's index(es) in the file output. If
453450
``False``, they will not be written to the file.

pandas/tests/io/test_parquet.py

-6
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,6 @@ def test_columns_dtypes(self, engine):
404404

405405
@pytest.mark.parametrize("compression", [None, "gzip", "snappy", "brotli"])
406406
def test_compression(self, engine, compression):
407-
if compression == "snappy":
408-
pytest.importorskip("snappy")
409-
410-
elif compression == "brotli":
411-
pytest.importorskip("brotli")
412-
413407
df = pd.DataFrame({"A": [1, 2, 3]})
414408
check_round_trip(df, engine, write_kwargs={"compression": compression})
415409

pyproject.toml

+1-3
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,12 @@ xml = ['lxml>=4.8.0']
8181
plot = ['matplotlib>=3.6.1']
8282
output_formatting = ['jinja2>=3.1.2', 'tabulate>=0.8.10']
8383
clipboard = ['PyQt5>=5.15.6', 'qtpy>=2.2.0']
84-
compression = ['brotlipy>=0.7.0', 'python-snappy>=0.6.1', 'zstandard>=0.17.0']
84+
compression = ['zstandard>=0.17.0']
8585
consortium-standard = ['dataframe-api-compat>=0.1.7']
8686
all = ['beautifulsoup4>=4.11.1',
8787
# blosc only available on conda (https://github.com/Blosc/python-blosc/issues/297)
8888
#'blosc>=1.21.0',
8989
'bottleneck>=1.3.4',
90-
'brotlipy>=0.7.0',
9190
'dataframe-api-compat>=0.1.7',
9291
'fastparquet>=0.8.1',
9392
'fsspec>=2022.05.0',
@@ -110,7 +109,6 @@ all = ['beautifulsoup4>=4.11.1',
110109
'pytest>=7.3.2',
111110
'pytest-xdist>=2.2.0',
112111
'pytest-asyncio>=0.17.0',
113-
'python-snappy>=0.6.1',
114112
'pyxlsb>=1.0.9',
115113
'qtpy>=2.2.0',
116114
'scipy>=1.8.1',

requirements-dev.txt

-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ numpy
1616
pytz
1717
beautifulsoup4>=4.11.1
1818
blosc
19-
brotlipy>=0.7.0
2019
bottleneck>=1.3.4
2120
fastparquet>=0.8.1
2221
fsspec>=2022.05.0
@@ -37,7 +36,6 @@ pyarrow>=7.0.0
3736
pymysql>=1.0.2
3837
pyreadstat>=1.1.5
3938
tables>=3.7.0
40-
python-snappy>=0.6.1
4139
pyxlsb>=1.0.9
4240
s3fs>=2022.05.0
4341
scipy>=1.8.1

scripts/tests/data/deps_expected_random.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ dependencies:
2626
- beautifulsoup4>=5.9.3
2727
- blosc
2828
- bottleneck>=1.3.2
29-
- brotlipy>=0.7.0
3029
- fastparquet>=0.6.3
3130
- fsspec>=2021.07.0
3231
- html5lib>=1.1
@@ -45,7 +44,6 @@ dependencies:
4544
- pymysql>=1.0.2
4645
- pyreadstat>=1.1.2
4746
- pytables>=3.6.1
48-
- python-snappy>=0.6.0
4947
- pyxlsb>=1.0.8
5048
- s3fs>=2021.08.0
5149
- scipy>=1.7.1

scripts/tests/data/deps_minimum.toml

+1-3
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,11 @@ xml = ['lxml>=4.6.3']
7777
plot = ['matplotlib>=3.6.1']
7878
output_formatting = ['jinja2>=3.0.0', 'tabulate>=0.8.9']
7979
clipboard = ['PyQt5>=5.15.1', 'qtpy>=2.2.0']
80-
compression = ['brotlipy>=0.7.0', 'python-snappy>=0.6.0', 'zstandard>=0.15.2']
80+
compression = ['zstandard>=0.15.2']
8181
all = ['beautifulsoup4>=5.9.3',
8282
# blosc only available on conda (https://github.com/Blosc/python-blosc/issues/297)
8383
#'blosc>=1.21.0',
8484
'bottleneck>=1.3.2',
85-
'brotlipy>=0.7.0',
8685
'fastparquet>=0.6.3',
8786
'fsspec>=2021.07.0',
8887
'gcsfs>=2021.07.0',
@@ -104,7 +103,6 @@ all = ['beautifulsoup4>=5.9.3',
104103
'pytest>=7.3.2',
105104
'pytest-xdist>=2.2.0',
106105
'pytest-asyncio>=0.17.0',
107-
'python-snappy>=0.6.0',
108106
'pyxlsb>=1.0.8',
109107
'qtpy>=2.2.0',
110108
'scipy>=1.7.1',

scripts/tests/data/deps_unmodified_random.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ dependencies:
2626
- beautifulsoup4
2727
- blosc
2828
- bottleneck>=1.3.2
29-
- brotlipy
3029
- fastparquet>=0.6.3
3130
- fsspec>=2021.07.0
3231
- html5lib>=1.1
@@ -45,7 +44,6 @@ dependencies:
4544
- pymysql>=1.0.2
4645
- pyreadstat>=1.1.2
4746
- pytables>=3.6.1
48-
- python-snappy>=0.6.0
4947
- pyxlsb>=1.0.8
5048
- s3fs>=2021.08.0
5149
- scipy>=1.7.1

0 commit comments

Comments
 (0)