Closed weiji14 closed 1 year ago
Happy to open a PR to make python-snappy optional if the above sounds good!
Hi @weiji14. Yes please!
It looks like from https://github.com/andrix/python-snappy/issues/124 that the recommendation is to replace use of python-snappy
with cramjam
instead. But that is long-term, at the moment I'd be happy if our CI passes without python-snappy
.
It looks like from andrix/python-snappy#124 that the recommendation is to replace use of
python-snappy
withcramjam
instead. But that is long-term, at the moment I'd be happy if our CI passes withoutpython-snappy
.
Cool, started a PR at #117. We could look into cramjam
separately, it looks like a promising replacement built on Rust!
Is your feature request related to a problem? Please describe.
Trying to install
spatialpandas
in a Python 3.11 environment currently fails due to a hard dependency onpython-snappy
which doesn't have wheels for Python 3.11 (see https://github.com/andrix/python-snappy/issues/124).produces this traceback
Describe the solution you'd like
A clear and concise description of what you want to happen.
Convert
python-snappy
from a required to an optional dependency in thesetup.py
file:https://github.com/holoviz/spatialpandas/blob/bc3e52cfb2ef84c411ad0aff34a683ee0955ce66/setup.py#L31-L40
Looking at the codebase, I only see
snappy
mentioned for the parquet I/O in two places:https://github.com/holoviz/spatialpandas/blob/bc3e52cfb2ef84c411ad0aff34a683ee0955ce66/spatialpandas/dask.py#L208 https://github.com/holoviz/spatialpandas/blob/bc3e52cfb2ef84c411ad0aff34a683ee0955ce66/spatialpandas/io/parquet.py#L90-L181
So for operations that don't use parquet, it should not be necessary to use
python-snappy
. Note thatpandas
does support other compression methods likegzip
as mentioned at https://pandas.pydata.org/pandas-docs/version/2.0/reference/api/pandas.DataFrame.to_parquet.html, thoughsnappy
compression is currently the default.Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Ideally,
python-snappy
would release Python 3.11 compatible wheels at https://github.com/andrix/python-snappy/issues/124, but the last commit on that repo was 17 Mar 2022, so not likely to happen anytime soon.Additional context
Add any other context or screenshots about the feature request here.
I noticed that there was a PR checking for Python 3.11 compatibility at https://github.com/holoviz/spatialpandas/pull/113, but in that case,
python-snappy
was installed fromconda-forge
(that does support Python 3.11 https://anaconda.org/conda-forge/python-snappy/files?version=0.6.1) rather than PyPI.For historical context,
snappy
was added as a required dependency in 498e7fcd0f73132ffde472ada1fa22f3037205df/#60.Happy to open a PR to make
python-snappy
optional if the above sounds good!