Comments (1)
Can reproduce.
pl.DataFrame({"A": [[[1.0], [2]]]})
# shape: (1, 1)
# ┌─────────────────┐
# │ A │
# │ --- │
# │ list[list[f64]] │
# ╞═════════════════╡
# │ [[1.0], [2.0]] │
# └─────────────────┘
pl.DataFrame({"A": [[{"B":1.0}, {"B":2}]]})
TypeError: unexpected value while building Series of type Float64; found value of type Int64: 2
INFER_SCHEMA_LENGTH
is hardcoded to 25 here, but it doesn't seem to come into play:
polars/py-polars/src/conversion/any_value.rs
Lines 289 to 290 in bfcc1ee
The issue seems to be that structs are treated differently to other types.
e.g. inside to_list
there is an explicit cast:
polars/crates/polars-core/src/series/any_value.rs
Lines 514 to 515 in bfcc1ee
But to_struct
ends up calling from_any_values_and_dtype
again on the inner values:
So in this case, we end up with a strict call on the inner values that fails.
Series::from_any_values_and_dtype("name", [1.0, 2], Float64, true)
from polars.
Related Issues (20)
- read_database_uri panics for dates beyond 2262.04.11 HOT 2
- Move streaming engine original plan to separate field on the `IRPlan`
- Write upgrade guide for 1.0.0
- Polars is unable to parse dates beyond 2262.04.11 HOT 1
- Make a ParquetWriter context handler and/or more control over row group creation
- Casting to float32, int32, int16 and int8 in polars is slower than pandas in larger dfs HOT 4
- Interpolate based on other Float64 column HOT 3
- Comparing 0 with UInt64 values larger than Int64::MAX incorrectly return NULL
- `read_csv` ignores the `columns` parameter when reading an empty CSV file with header HOT 1
- Inconsistent XOR when using literals
- `pl.concat_str(...)`'s `ignore_nulls` arg field
- In `pl.read_csv(...)`, allow `separator=None` in order to read everything into only a single column HOT 1
- pl.DataFrame loads in 2D lists in unexpected way HOT 5
- `join_asof` breaks with certain parquet files (I think due to memory layout or something?) HOT 2
- Expressions result in different serializations across Python Polars PATCH version upgrades HOT 1
- Add inline XOR (`^`) operator for selectors HOT 3
- Inconsistency in constructing dataframes with timezone-aware datatypes HOT 8
- "Failed to determine supertype of bool and datetime[ns]" Panic
- suggest sql add `select sth` without a `from` syntax HOT 4
- Unexpected `index out of bounds` error for specific dataset and set of operations HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polars.