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

Incorrect writing of NULL rows for struct column containing Decimal with precision >18 to Parquet #19448

Open
2 tasks done
nameexhaustion opened this issue Oct 25, 2024 · 0 comments
Labels
A-dtype-decimal Area: decimal data type A-io-parquet Area: reading/writing Parquet files accepted Ready for implementation bug Something isn't working P-low Priority: low python Related to Python Polars

Comments

@nameexhaustion
Copy link
Collaborator

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 io
import polars as pl

pl.DataFrame(
    {"x": [{"a": None}, None]}, schema={"x": pl.Struct({"a": pl.Decimal(19, 2)})}
).write_parquet(f := io.BytesIO())
f.seek(0)
print(pl.read_parquet(f))

# Output
# shape: (2, 1)
# ┌───────────┐
# │ x         │
# │ ---       │
# │ struct[1] │
# ╞═══════════╡
# │ null      │
# │ null      │
# └───────────┘
#
# Expected
# shape: (2, 1)
# ┌───────────┐
# │ x         │
# │ ---       │
# │ struct[1] │
# ╞═══════════╡
# │ {null}    │
# │ null      │
# └───────────┘

Log output

No response

Issue description

The outer validity gets incorrectly set.

Expected behavior

See example code

Installed versions

1.11.0

@nameexhaustion nameexhaustion added bug Something isn't working python Related to Python Polars needs triage Awaiting prioritization by a maintainer A-dtype-decimal Area: decimal data type P-medium Priority: medium A-io-parquet Area: reading/writing Parquet files P-low Priority: low and removed needs triage Awaiting prioritization by a maintainer P-medium Priority: medium labels Oct 25, 2024
@nameexhaustion nameexhaustion added the accepted Ready for implementation label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dtype-decimal Area: decimal data type A-io-parquet Area: reading/writing Parquet files accepted Ready for implementation bug Something isn't working P-low Priority: low python Related to Python Polars
Projects
Status: Ready
Development

No branches or pull requests

1 participant