GithubHelp home page GithubHelp logo

Comments (2)

cmdlineluser avatar cmdlineluser commented on July 17, 2024 1

Just some notes from attempting to debug this:

It appears that there are 2 places where this can happen depending on whether fsspec is installed or not.

# decode first
with Path(file).open(encoding=encoding_str) as f:
return _check_empty(

if isinstance(file, str):
file = normalize_filepath(file, check_not_directory=check_not_dir)
if not has_utf8_utf8_lossy_encoding:
with Path(file).open(encoding=encoding_str) as f:
return _check_empty(
BytesIO(f.read().encode("utf8")),
context=f"{file!r}",
raise_if_empty=raise_if_empty,
)

And it's being passed directly to pathlib.Path() - hence the lack of glob expansion.

from polars.

christian-hnz avatar christian-hnz commented on July 17, 2024

The _utils module has a _is_glob_pattern checker function, which is also used in the DataFrame._read_csv method (called by the read_csv function) to capture an unsupported combination of arguments ... a similar move would at least get rid of the misleading error.

Considering the alternative, my first impression is that using, e.g., the stdlib's glob.glob internally is quite a bit of effort for such an edge case .. which can be done by something like pl.concat(pl.read_csv(f, encoding=...) for f in glob.glob("test_*.py")).

from polars.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.