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
{{ message }}
Repository navigation
DuckDBPyConnection.from_csv_auto typing not updated for file-like input #279
That only describes feeding it a path or filename, but not a file-like object (see duckdb/duckdb#6568). Passing a file-like object (such as io.StringIO) results in a type-checking error (Pylance, in my case).
Pylance flags the string parameter in the last line with:
Argument of type "StringIO" cannot be assigned to parameter "path_or_buffer" of type "str | bytes | PathLike[str]" in function "read_csv"
Type "StringIO" is not assignable to type "str | bytes | PathLike[str]"
"StringIO" is not assignable to "str"
"StringIO" is not assignable to "bytes"
"StringIO" is incompatible with protocol "PathLike[str]"
"__fspath__" is not present
OS:
Windows 11 x86_64
DuckDB Package Version:
1.4.3
Python Version:
3.14.2
Full Name:
Peter Kidwell
Affiliation:
The Boeing Company
What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have tested with a stable release
Did you include all relevant data sets for reproducing the issue?
Not applicable - the reproduction does not require a data set
Did you include all code required to reproduce the issue?
Yes, I have
Did you include all relevant configuration to reproduce the issue?
Fixed in #323. Added IO[bytes] and os.PathLike[bytes] to the path_or_buffer parameter in from_csv_auto and read_csv. Also matched the types between from_csv_auto and read_csv since they share the same implementation.
Activity
evertlammerts commentedon Feb 17, 2026
Fixed in #323. Added
IO[bytes]andos.PathLike[bytes]to thepath_or_bufferparameter infrom_csv_autoandread_csv. Also matched the types betweenfrom_csv_autoandread_csvsince they share the same implementation.Fix multiple stub issues (#323)