r-polars
r-polars copied to clipboard
`pl$Struct()` must have named elements
> 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