{"record":{"id":"e263d27c3e35bd80","repo":"nautechsystems/nautilus_trader","slug":"unsupported-data-variant-for-catalog-writes","errorCode":null,"errorMessage":"Unsupported Data variant for catalog writes","messagePattern":"Unsupported Data variant for catalog writes","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/persistence/src/backend/catalog.rs","lineNumber":456,"sourceCode":"                Data::FundingRate(p) => {\n                    funding_rates.push(p);\n                }\n                Data::OptionGreeks(g) => {\n                    option_greeks.push(g);\n                }\n                Data::InstrumentStatus(s) => {\n                    statuses.push(s);\n                }\n                Data::InstrumentClose(c) => {\n                    closes.push(c);\n                }\n                Data::Custom(c) => {\n                    custom_data.entry(custom_data_key(&c)).or_default().push(c);\n                }\n                #[cfg(feature = \"defi\")]\n                Data::Defi(_) => anyhow::bail!(\"Unsupported Data::Defi variant for catalog writes\"),\n                #[allow(unreachable_patterns)]\n                _ => anyhow::bail!(\"Unsupported Data variant for catalog writes\"),\n            }\n        }\n\n        // Instruments are handled separately via write_instruments method\n\n        // Group each type by its identity so one write never mixes identifiers:\n        // the target directory and schema metadata are taken from the first\n        // element, so a mixed write would silently re-label the rest\n        self.write_grouped_to_parquet(deltas, start, end, skip_disjoint_check, |d| {\n            d.instrument_id\n        })?;\n        self.write_grouped_to_parquet(depth10s, start, end, skip_disjoint_check, |d| {\n            d.instrument_id\n        })?;\n        self.write_grouped_to_parquet(quotes, start, end, skip_disjoint_check, |q| {\n            q.instrument_id\n        })?;\n        self.write_grouped_to_parquet(trades, start, end, skip_disjoint_check, |t| {","sourceCodeStart":438,"sourceCodeEnd":474,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/persistence/src/backend/catalog.rs#L438-L474","documentation":"Catch-all arm in `ParquetDataCatalog::write_data_enum`: the `Data` enum contained a variant that is neither an instrument, order-book, quote, trade, nor `Data::Custom` type that the writer recognizes. The writer refuses instead of guessing how to serialize it.","triggerScenarios":"Calling `write_data_enum` with a `Data` value whose inner type does not map to any supported Parquet-writable type, typically a newly added or unusual data variant not covered by the explicit match arms.","commonSituations":"Using a newer nautilus_model version whose `Data` enum gained variants the persistence crate does not yet handle; passing synthetically constructed `Data` values; forwarding custom types that do not implement the catalog custom-data contract.","solutions":["Identify the offending variant (log `data` or its type name before the write) and exclude it from the buffer.","Confirm the persistence crate and nautilus_model versions are in sync (upgrade persistence if the model added variants).","If it is a custom type, ensure it was registered via `#[custom_data]` so it matches `Data::Custom`."],"exampleFix":"// before\ncatalog.write_data_enum(&data, None, None, None)?;\n// after\nlet writable: Vec<Data> = data.into_iter()\n    .filter(|d| !matches!(d, Data::Defi(_)))\n    .collect();\ncatalog.write_data_enum(&writable, None, None, None)?;","handlingStrategy":"validation","validationCode":"fn is_writable(d: &nautilus_model::data::Data) -> bool {\n    !matches!(d, nautilus_model::data::Data::Other(_) | nautilus_model::data::Data::Defi(_))\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = catalog.write_data_enum(&data, None, None, None) {\n    log::warn!(\"skipping unsupported data: {e}\");\n    // inspect and handle the offending variant manually\n}","preventionTips":["Pin nautilus_model and nautilus_persistence to compatible versions","Filter to explicitly supported variants before writing","Log the variant type name before writing in ingestion pipelines"],"tags":["rust","persistence","parquet","unsupported-operation","version-mismatch"],"backgroundTag":"unsupported-operation","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}