Traceback (most recent call last):
File "[...]", line 22, in <module>
pl.scan_csv(
~~~~~~~~~~~^
"foobar.txt.zst",
^^^^^^^^^^^^^^^^^
...<2 lines>...
new_columns=["foo", "bar", "baz", "qux", "quux", "corge"],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
).collect()
^
File "[...]/lib/python3.13/site-packages/polars/_utils/deprecation.py", line 92, in wrapper
return function(*args, **kwargs)
File "[...]/lib/python3.13/site-packages/polars/_utils/deprecation.py", line 92, in wrapper
return function(*args, **kwargs)
File "[...]/lib/python3.13/site-packages/polars/_utils/deprecation.py", line 92, in wrapper
return function(*args, **kwargs)
File "[...]/lib/python3.13/site-packages/polars/io/csv/functions.py", line 1296, in scan_csv
return _scan_csv_impl(
source,
...<30 lines>...
include_file_paths=include_file_paths,
)
File "[...]/lib/python3.13/site-packages/polars/io/csv/functions.py", line 1394, in _scan_csv_impl
pylf = PyLazyFrame.new_from_csv(
source,
...<30 lines>...
include_file_paths=include_file_paths,
)
polars.exceptions.ShapeError: The length of the new names list should be equal to or less than the original column length
Issue description
When scanning zstd compressed text files, there is strange behavior on whether or not it is possible to define a new set of column names for a headerless file without error. This is related to #17841 which seems to have brought forth the support that didn't exist for compressed files in scan_csv() previously.
Expected behavior
A list of column names should populate a lazy frame during scanning when the number of columns is equal to the number of elements in the list.
Checks
Reproducible example
Log output
Issue description
When scanning zstd compressed text files, there is strange behavior on whether or not it is possible to define a new set of column names for a headerless file without error. This is related to #17841 which seems to have brought forth the support that didn't exist for compressed files in
scan_csv()
previously.Expected behavior
A list of column names should populate a lazy frame during scanning when the number of columns is equal to the number of elements in the list.
Installed versions