Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In scan_parquet(), include_file_paths returns twice the same column #18219

Closed
2 tasks done
etiennebacher opened this issue Aug 15, 2024 · 1 comment · Fixed by #18255
Closed
2 tasks done

In scan_parquet(), include_file_paths returns twice the same column #18219

etiennebacher opened this issue Aug 15, 2024 · 1 comment · Fixed by #18255
Assignees
Labels
A-io-parquet Area: reading/writing Parquet files accepted Ready for implementation bug Something isn't working P-medium Priority: medium python Related to Python Polars

Comments

@etiennebacher
Copy link

etiennebacher commented Aug 15, 2024

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

import polars as pl

# need to create the folders "data/b=1" and "data/b=2" first
pl.DataFrame({"a": [1]}).write_parquet("data/b=1/data.parquet")
pl.DataFrame({"a": [2]}).write_parquet("data/b=2/data.parquet")

pl.scan_parquet("data", include_file_paths="file_paths").collect()

Log output

shape: (2, 4)
┌─────┬─────┬───────────────────────┬───────────────────────┐
│ a   ┆ b   ┆ file_paths            ┆ file_paths            │
│ --- ┆ --- ┆ ---                   ┆ ---                   │
│ i64 ┆ i64 ┆ str                   ┆ str                   │
╞═════╪═════╪═══════════════════════╪═══════════════════════╡
│ 1   ┆ 1   ┆ data\b=1\data.parquet ┆ data\b=1\data.parquet │
│ 2   ┆ 2   ┆ data\b=2\data.parquet ┆ data\b=2\data.parquet │
└─────┴─────┴───────────────────────┴───────────────────────┘

Issue description

If include_file_paths is specified, it includes the same column twice.

Expected behavior

The output should contain only one column with the file paths.

Installed versions

--------Version info---------
Polars:               1.5.0 
Index type:           UInt32
Platform:             Windows-10-10.0.19045-SP0
Python:               3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)]

----Optional dependencies----
adbc_driver_manager:  <not installed>
cloudpickle:          <not installed>
connectorx:           <not installed>
deltalake:            <not installed>
fastexcel:            <not installed>
fsspec:               2023.6.0       
gevent:               <not installed>
great_tables:         <not installed>
hvplot:               0.9.2
matplotlib:           3.7.1
nest_asyncio:         1.5.6
numpy:                1.24.3
openpyxl:             <not installed>
pandas:               2.0.3
pyarrow:              12.0.1
pydantic:             2.6.4
pyiceberg:            <not installed>
sqlalchemy:           <not installed>
torch:                <not installed>
xlsx2csv:             <not installed>
xlsxwriter:           <not installed>
@etiennebacher etiennebacher added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Aug 15, 2024
@ritchie46
Copy link
Member

@nameexhaustion can you take this one?

@nameexhaustion nameexhaustion self-assigned this Aug 18, 2024
@nameexhaustion nameexhaustion added accepted Ready for implementation P-medium Priority: medium A-io-parquet Area: reading/writing Parquet files and removed needs triage Awaiting prioritization by a maintainer labels Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-io-parquet Area: reading/writing Parquet files accepted Ready for implementation bug Something isn't working P-medium Priority: medium python Related to Python Polars
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants