Open danpatton opened 2 months ago
The issue is that pl.from_numpy(data, schema=["foo"])
returns a 0,0
dataframe. Since a dataframe is just a collection of Series, having 0 columns means no Series to store dtype info.
A Series
doesn't have columns, it is a column, so when you do pl.Series("foo", data)
it has no issue stashing the dtype in itself.
@alexander-beedie is there a workable solution here? Maybe make from_numpy
return (0,1) instead of (0,0)?
If you explicitly provide a schema with the dtypes this is not an issue
If you explicitly provide a schema with the dtypes this is not an issue
I tried this, but it gives the same behaviour:
assert_frame_equal(pl.from_numpy(data, schema={"foo": pl.Float32}), pl.Series("foo", data).to_frame())
Checks
Reproducible example
Log output
Issue description
If you change the shape of
data
to(1,)
then the assertion passesExpected behavior
Assertion passes when the shape of the data is
(0,)
Installed versions