GithubHelp home page GithubHelp logo

Comments (5)

corwinjoy avatar corwinjoy commented on September 24, 2024 1

@adamreeve @wukan1986
I have put in a PR to fix this issue. The fix was straightforward, but I am new to this project and am hoping to get help with the associated unit tests.

from polars.

taki-mekhalfa avatar taki-mekhalfa commented on September 24, 2024

Is not it sensible to keep the behavior as it? Parquet files without a schema? I think write_parquet should error when trying to write schema-less parquets.

Duckdb fails to read the file too: Error: Invalid Error: Failed to read Parquet file "test.parquet": Need at least one non-root column in the file

from polars.

wukan1986 avatar wukan1986 commented on September 24, 2024

Hi, @taki-mekhalfa

This problem easily occurs when reading a folder, because the folder contains files generated by other software using pandas and saved daily. There is no data on the new day, but the files are generated.
However, if you read the folder directly here, an error will be reported.

from polars.

adamreeve avatar adamreeve commented on September 24, 2024

Is not it sensible to keep the behavior as it? Parquet files without a schema? I think write_parquet should error when trying to write schema-less parquets.

I disagree, it is completely valid to create an empty Polars DataFrame, so why should it not be possible to round-trip this via Parquet too? I would also not describe such a file as schema-less, there is a schema and it has zero columns.

As a counter-example to DuckDB, PyArrow can read and write Parquet files with zero columns without any problem, as shown in the example in the description.

from polars.

corwinjoy avatar corwinjoy commented on September 24, 2024

I have started working on this. This has also been reported as part of (#9016) where @gregates helpfully gave some Rust code for reproducing this directly.

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.