Reproduction 1 (test)
cd python
uv run python -m pytest tests/platform/test_shared_pipeline.py::TestPipeline::test_pandas_struct
... will yield:
FAILED tests/platform/test_shared_pipeline.py::TestPipeline::test_pandas_struct - KeyError: 'type'
... for PR #6288
Reproduction 2 (SQL)
Create a pipeline example with SQL:
CREATE TYPE s_struct AS (
f1 INT,
f2 STRING
);
CREATE TABLE tbl_struct (c1 s_struct);
CREATE VIEW v_struct AS SELECT c1 FROM tbl_struct;
Visit: http://localhost:8080/v0/pipelines/example?selector=all, if you look in field program_info you'll see the following:
{
"name": "tbl_struct",
"case_sensitive": false,
"fields": [
{
"name": "c1",
"case_sensitive": false,
"columntype": {
"fields": [
{
"name": "f1",
"nullable": true,
"type": "INTEGER"
},
{
"name": "f2",
"nullable": true,
"precision": -1,
"type": "VARCHAR"
}
],
"nullable": true
},
"unused": false
}
],
"materialized": false,
"foreign_keys": []
},
... where columntype of c1 does not contain type.
Issue
The issue is that columntype.type is not an optional field (Option<...>), but uses #[serde(default = "default_is_struct")].
Reproduction 1 (test)
... will yield:
... for PR #6288
Reproduction 2 (SQL)
Create a pipeline
examplewith SQL:Visit:
http://localhost:8080/v0/pipelines/example?selector=all, if you look in fieldprogram_infoyou'll see the following:... where
columntypeofc1does not containtype.Issue
The issue is that
columntype.typeis not an optional field (Option<...>), but uses#[serde(default = "default_is_struct")].