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

Extra column when file_name contains an "=" sign, after write_parquet and read_parquet #14125

Closed
2 tasks done
PierreOreistein opened this issue Jan 31, 2024 · 1 comment · Fixed by #14128
Closed
2 tasks done
Assignees
Labels
accepted Ready for implementation bug Something isn't working needs triage Awaiting prioritization by a maintainer P-medium Priority: medium python Related to Python Polars

Comments

@PierreOreistein
Copy link

PierreOreistein commented Jan 31, 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

first_df = pl.DataFrame({"col_a": [0, 1, 2], "col_b": ["a", "b", "c"]})
print(first_df)
first_df.write_parquet("data=1.parquet")

second_df = pl.read_parquet("data=1.parquet")
print(second_df)

image

Log output

No response

Issue description

Context

After saving a file with an equal sign "=", and reloading it, we can observe an extra column.

This issue does not happen when removing the equal sign "=" from the file name.

first_df.write_parquet("data_1.parquet")

second_df = pl.read_parquet("data_1.parquet")
print(second_df)

image

Expected behavior

No extra column when saving a file with an equal sign.

Installed versions

--------Version info---------
Polars:               0.20.6
Index type:           UInt32
Platform:             Linux-5.4.56.bsk.10-amd64-x86_64-with-glibc2.31
Python:               3.9.18 (main, Jan 26 2024, 14:16:18) 
[GCC 10.2.1 20210110]

----Optional dependencies----
adbc_driver_manager:  <not installed>
cloudpickle:          <not installed>
connectorx:           <not installed>
deltalake:            <not installed>
fsspec:               <not installed>
gevent:               21.12.0
hvplot:               <not installed>
matplotlib:           <not installed>
numpy:                1.26.3
openpyxl:             3.1.2
pandas:               2.2.0
pyarrow:              15.0.0
pydantic:             <not installed>
pyiceberg:            <not installed>
pyxlsb:               <not installed>
sqlalchemy:           <not installed>
xlsx2csv:             <not installed>
xlsxwriter:           <not installed>
@PierreOreistein PierreOreistein added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Jan 31, 2024
@PierreOreistein PierreOreistein changed the title Extra columns when file_name contains an "=" sign Extra column when file_name contains an "=" sign, after write_parquet and read_parquet Jan 31, 2024
@ritchie46
Copy link
Member

ritchie46 commented Jan 31, 2024

Set hive_partitioning=False.

EDIT: Hmm.. this should only be triggered by directories, not by filenames.

@ritchie46 ritchie46 added invalid A bug report that is not actually a bug bug Something isn't working P-medium Priority: medium and removed bug Something isn't working invalid A bug report that is not actually a bug labels Jan 31, 2024
@c-peters c-peters added the accepted Ready for implementation label Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation bug Something isn't working needs triage Awaiting prioritization by a maintainer 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