You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently if Python is built without lzma, following #27882 a warning is going to be shown to users at import time,
lib/python3.9/site-packages/pandas/compat/__init__.py:117: UserWarning: Could not import the lzma
module. Your installed Python is incomplete. Attempting to use lzma compression will result in a
RuntimeError.
I don't believe this is helpful. While lzma is part of stdlib, CPython builds perfectly fine without lzma, and most of the test suite gracefully handles the fact that lzma might be missing.
Of course the RuntimeError is unavoidable, but I think the warning about "Your installed Python is incomplete" at import time is confusing to users. Particularly that in my, possibly biased experience, opening xz compressed files is not that common: users would most often either read plain text/csv for readability (possibly gzip compressed) or switch to parquet with compression if they care about size/performance. So most users should not be affected by this even if they don't have lzma.
For instance in Pyodide this warning makes users wonder what is wrong with their install pyodide/pyodide#1821 :) We will likely include lzma eventually, but so far there haven't been much requests for it (and every extra module has a download size penalty).
The text was updated successfully, but these errors were encountered:
Seeing that warning in pyodide made me wonder about revisiting this issue :) Thanks for opening this.
The fact that Python itself imports without warning when the lzma module isn't present is a pretty compelling argument to remove the warning. So I'd be +1 on removing it.
To avoid future regressions we would want to ensure that we have a test verifying that the lzma module isn't imported by default with pandas.
lithomas1
added
Compat
pandas objects compatability with Numpy or Python functions
Warnings
Warnings that appear or should be added to pandas
labels
Sep 10, 2021
Currently if Python is built without lzma, following #27882 a warning is going to be shown to users at import time,
I don't believe this is helpful. While lzma is part of stdlib, CPython builds perfectly fine without lzma, and most of the test suite gracefully handles the fact that lzma might be missing.
Of course the
RuntimeError
is unavoidable, but I think the warning about "Your installed Python is incomplete" at import time is confusing to users. Particularly that in my, possibly biased experience, opening xz compressed files is not that common: users would most often either read plain text/csv for readability (possibly gzip compressed) or switch to parquet with compression if they care about size/performance. So most users should not be affected by this even if they don't have lzma.For instance in Pyodide this warning makes users wonder what is wrong with their install pyodide/pyodide#1821 :) We will likely include lzma eventually, but so far there haven't been much requests for it (and every extra module has a download size penalty).
The text was updated successfully, but these errors were encountered: