{"record":{"id":"0e2087413c2ab279","repo":"nautechsystems/nautilus_trader","slug":"inconsistent-symbology-types-first-stype-for","errorCode":null,"errorMessage":"Inconsistent symbology types: '{first_stype}' for {first_symbol} vs '{next_stype}' for {symbol}","messagePattern":"Inconsistent symbology types: '(.+?)' for (.+?) vs '(.+?)' for (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/databento/src/symbology.rs","lineNumber":188,"sourceCode":"    }\n\n    SType::RawSymbol\n}\n\n/// # Errors\n///\n/// Returns an error if `symbols` is empty or symbols have inconsistent symbology types.\npub fn check_consistent_symbology(symbols: &[&str]) -> anyhow::Result<()> {\n    if symbols.is_empty() {\n        anyhow::bail!(\"No symbols provided\");\n    }\n    let first_symbol = symbols[0];\n    let first_stype = infer_symbology_type(first_symbol);\n\n    for symbol in symbols {\n        let next_stype = infer_symbology_type(symbol);\n        if next_stype != first_stype {\n            anyhow::bail!(\n                \"Inconsistent symbology types: '{first_stype}' for {first_symbol} vs '{next_stype}' for {symbol}\"\n            );\n        }\n    }\n\n    Ok(())\n}\n\n#[cfg(test)]\nmod tests {\n    use rstest::*;\n\n    use super::*;\n\n    #[rstest]\n    #[case(\"1\", \"instrument_id\")]\n    #[case(\"123456789\", \"instrument_id\")]\n    #[case(\"AAPL\", \"raw_symbol\")]","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/databento/src/symbology.rs#L170-L206","documentation":"Databento range requests require all symbols to use the same symbology type (e.g. raw, smart, continuous, parent). check_consistent_symbology infers each symbol's stype and fails if they differ, since a single request stype cannot serve mixed types.","triggerScenarios":"Calling a get_range_* function with symbols mixing conventions, e.g. [\"ESZ5\", \"ES.c.0\"] (raw + continuous) or mixing smart and parent ids.","commonSituations":"Combining symbols from different config sources or user input; confusing Databento stype conventions; merging symbol lists built with different inference rules.","solutions":["Normalize all symbols to one symbology type before the call","Split the request into multiple calls grouped by symbology type","Use explicit stype-in-encoded-symbol syntax (e.g. 'continuous:ES') consistently","Review how symbols are collected to avoid mixed conventions"],"exampleFix":"// before\nget_range_trades(&[\"ES.c.0\", \"ESZ5\"], SType::Raw)  // mixed\n// after\nget_range_trades(&[\"ES.c.0\"], SType::Continuous)\nget_range_trades(&[\"ESZ5\"], SType::Raw)","handlingStrategy":"validation","validationCode":"let stypes: HashSet<_> = symbols.iter().map(|s| infer_symbology_type(s)).collect();\nassert!(stypes.len() == 1, \"mixed symbology types: {:?}\", stypes);","typeGuard":null,"tryCatchPattern":"match get_range_trades(&symbols, stype).await {\n    Err(e) if e.to_string().contains(\"Inconsistent symbology types\") => {\n        // split into per-stype groups and retry each\n    }\n    other => other?,\n}","preventionTips":["Normalize all symbols to one symbology type before requests","Use explicit stype-in-encoded-symbol syntax consistently","Group requests by symbology type instead of mixing"],"tags":["databento","validation","symbology","symbols"],"backgroundTag":"invalid-argument-value","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"}