{"record":{"id":"57f6548edca766c6","repo":"nautechsystems/nautilus_trader","slug":"unsupported-data-type-type-name","errorCode":null,"errorMessage":"Unsupported data type: {type_name}","messagePattern":"Unsupported data type: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/persistence/src/backend/catalog_operations.rs","lineNumber":1821,"sourceCode":"        start: Option<UnixNanos>,\n        end: Option<UnixNanos>,\n    ) -> anyhow::Result<()> {\n        // Use match statement to call the generic delete_data_range for various types\n        match type_name {\n            \"quotes\" => self.delete_data_range_generic::<QuoteTick>(identifier, start, end),\n            \"trades\" => self.delete_data_range_generic::<TradeTick>(identifier, start, end),\n            \"bars\" => self.delete_data_range_generic::<Bar>(identifier, start, end),\n            \"order_book_deltas\" => {\n                self.delete_data_range_generic::<OrderBookDelta>(identifier, start, end)\n            }\n            \"order_book_depth10\" => {\n                self.delete_data_range_generic::<OrderBookDepth10>(identifier, start, end)\n            }\n            _ => {\n                if let Some(custom_type_name) = type_name.strip_prefix(\"custom/\") {\n                    self.delete_custom_data_range(custom_type_name, identifier, start, end)\n                } else {\n                    anyhow::bail!(\"Unsupported data type: {type_name}\");\n                }\n            }\n        }\n    }\n\n    /// Deletes data within a specified time range across the entire catalog.\n    ///\n    /// This method identifies all leaf directories in the catalog that contain parquet files\n    /// and deletes data within the specified time range from each directory. A leaf directory\n    /// is one that contains files but no subdirectories. This is a convenience method that\n    /// effectively calls `delete_data_range` for all data types and instrument IDs in the catalog.\n    ///\n    /// # Parameters\n    ///\n    /// - `start`: Optional start timestamp for the deletion range. If None, deletes from the beginning.\n    /// - `end`: Optional end timestamp for the deletion range. If None, deletes to the end.\n    ///\n    /// # Returns","sourceCodeStart":1803,"sourceCodeEnd":1839,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/persistence/src/backend/catalog_operations.rs#L1803-L1839","documentation":"Raised by delete_data_range when the record's data type is not one of the built-in supported types and is also not a 'custom/<name>' type. The delete path has concrete generic implementations per known type (Quote, Trade, OrderBookDepth10, etc.) and a custom-data fallback; anything else cannot be dispatched.","triggerScenarios":"Calling delete_catalog_range / delete_data_range with an identifier whose type_name is neither a built-in type nor prefixed with 'custom/' — typically a typo in the type string or a type from a newer/older schema version.","commonSituations":"Hand-written type names like 'quotes' instead of the canonical 'Quote', reading a catalog written by a different NautilusTrader version with types this build doesn't know, or passing raw type names without the 'custom/' prefix for user-defined data.","solutions":["Check the exact type_name stored in the catalog (via the record/metadata) and use the canonical built-in name.","For user-defined types, ensure the name is passed as 'custom/<YourType>'.","Upgrade or align the NautilusTrader version so the catalog's data types are all supported by this build.","If the type truly is unsupported, delete the files manually or extend delete_data_range with the needed generic arm."],"exampleFix":"// before\nif let Some(custom) = type_name.strip_prefix(\"CustomTick\") { ... }\n// after — use the custom/ prefix for user-defined types\ndelete_catalog_range(&identifier_with_type_name(\"custom/CustomTick\"), start, end)?;","handlingStrategy":"type-guard","validationCode":"fn is_deletable(type_name: &str) -> bool {\n    matches!(type_name, \"Quote\" | \"Trade\" | \"OrderBookDepth10\" | \"OrderBookDelta\"\n        | \"Bar\" | \"Instrument...\" ) || type_name.starts_with(\"custom/\")\n}","typeGuard":"fn deletable_type(type_name: &str) -> Option<&str> {\n    if type_name.starts_with(\"custom/\") || is_builtin_type(type_name) { Some(type_name) } else { None }\n}","tryCatchPattern":"match catalog.delete_data_range(&identifier, start, end) {\n    Err(e) if e.to_string().starts_with(\"Unsupported data type\") => {\n        eprintln!(\"check type_name spelling or use 'custom/<name>' prefix\");\n    }\n    other => other?,\n}","preventionTips":["Take type_name from catalog metadata/records rather than typing it by hand.","Always prefix user-defined types with 'custom/'.","Keep reader and writer NautilusTrader versions aligned."],"tags":["rust","persistence","unsupported-type","delete"],"backgroundTag":"unsupported-operation","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}