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$Struct() must have named elements #1011

Closed
etiennebacher opened this issue Apr 2, 2024 · 0 comments · Fixed by #1053
Closed

pl$Struct() must have named elements #1011

etiennebacher opened this issue Apr 2, 2024 · 0 comments · Fixed by #1053
Labels
bug Something isn't working
Milestone

Comments

@etiennebacher
Copy link
Collaborator

etiennebacher commented Apr 2, 2024

> pl$Struct(x = pl$Float32)
DataType: Struct(
    [
        Field {
            name: "x",
            dtype: Float32,
        },
    ],
)
> pl$Struct(pl$Float32)
DataType: Struct(
    [
        Field {
            name: "",
            dtype: Float32,
        },
    ],
)
>>> pl.Struct({"x": pl.Float32})
Struct({'x': Float32})

>>> pl.Struct(pl.Float32)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python311\Lib\site-packages\polars\datatypes\classes.py", line 837, in __init__
    self.fields = list(fields)
                  ^^^^^^^^^^^^
TypeError: 'DataTypeClass' object is not iterable
@etiennebacher etiennebacher added the bug Something isn't working label Apr 2, 2024
@etiennebacher etiennebacher added this to the 0.17 milestone May 19, 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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant