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

pl.lit(None, dtype=pl.Struct({"a": pl.Int64()})) gives {'a': None}, not None #16696

Closed
2 tasks done
NickCrews opened this issue Jun 3, 2024 · 1 comment
Closed
2 tasks done
Labels
bug Something isn't working python Related to Python Polars

Comments

@NickCrews
Copy link

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
dtype = pl.Struct({"a": pl.Int64()})
e = pl.lit(None, dtype=dtype)
pl.select(e).item()

Log output

No response

Issue description

I am running into this in this PR for ibis.

But perhaps I am not understanding polars' data model for structs, maybe only field values can be NULL, but not the struct in its entirety? duckdb, apache arrow, and maybe others support the entire thing being NULL so thats why I'm thinking that's possible.

Expected behavior

I would expect this to result in a top level NULL.

Installed versions

--------Version info---------
Polars:               0.20.31
Index type:           UInt32
Platform:             Linux-6.1.85+-x86_64-with-glibc2.35
Python:               3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]

----Optional dependencies----
adbc_driver_manager:  <not installed>
cloudpickle:          2.2.1
connectorx:           <not installed>
deltalake:            <not installed>
fastexcel:            <not installed>
fsspec:               2023.6.0
gevent:               <not installed>
hvplot:               <not installed>
matplotlib:           3.7.1
nest_asyncio:         1.6.0
numpy:                1.25.2
openpyxl:             3.1.3
pandas:               2.0.3
pyarrow:              14.0.2
pydantic:             2.7.2
pyiceberg:            <not installed>
pyxlsb:               <not installed>
sqlalchemy:           2.0.30
torch:                2.3.0+cu121
xlsx2csv:             <not installed>
xlsxwriter:           <not installed>
@NickCrews NickCrews added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Jun 3, 2024
@stinodego
Copy link
Member

Thanks for the report. This is a known issue:
#3462

I'm closing this as a duplicate.

@stinodego stinodego closed this as not planned Won't fix, can't repro, duplicate, stale Jun 3, 2024
@stinodego stinodego removed the needs triage Awaiting prioritization by a maintainer label Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working python Related to Python Polars
Projects
None yet
Development

No branches or pull requests

2 participants