Commit dc3efc7
Fix Parquet IO-manager crash on non-scalar payload keys
The Dagster PayloadParquetIOManager crashed serializing source outputs:
pyarrow.lib.ArrowInvalid: Could not convert <SiteRecord ...> ... for column
"location"
A record's _payload can carry incidental non-scalar keys beyond its declared
schema — the FROST connectors leave the raw {location: SiteRecord, thing,
datastream, observation} in each observation's payload (ParameterTransformer
does rec.update(record)). The old pickle IO manager tolerated these; Parquet
can't. The combine only ever reads a record's declared keys anyway.
- orchestration/assets/products.py: the source asset now ships _schema_dict(r)
= {k: r._payload.get(k) for k in r.keys} for records/sites/timeseries — only
the declared scalar fields, dropping the junk.
- usgs/source.py: the USGS qualifier field is a list in the API; join it to a
scalar string so it stays consistent with the other sources and serializes
cleanly through both Parquet and the GeoJSON dump (it otherwise round-tripped
as a numpy array).
Reproduced and fixed locally end-to-end: ebid (SiteRecord junk) and nwis
(qualifier list) both now round-trip records+sites+timeseries through the Parquet
handoff. Full suite green (233 passed); products.py compiles.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent e7414b1 commit dc3efc7
3 files changed
Lines changed: 25 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
240 | 242 | | |
241 | | - | |
| 243 | + | |
242 | 244 | | |
243 | 245 | | |
244 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
142 | 149 | | |
143 | 150 | | |
144 | 151 | | |
| |||
298 | 305 | | |
299 | 306 | | |
300 | 307 | | |
301 | | - | |
302 | | - | |
303 | | - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
304 | 317 | | |
305 | | - | |
| 318 | + | |
306 | 319 | | |
307 | 320 | | |
308 | 321 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
23 | 24 | | |
24 | | - | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | | - | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
0 commit comments