nautechsystems/nautilus_trader · error

No symbols provided

Error message

No symbols provided

What it means

check_consistent_symbology validates that the caller supplied a non-empty list of symbols before issuing Databento range requests. An empty slice cannot form a valid symbology request, so it errors immediately.

Source

Thrown at crates/adapters/databento/src/symbology.rs:180

    let parts: Vec<&str> = symbol.split('.').collect();
    if parts.len() == 3 && parts[2].chars().all(|c| c.is_ascii_digit()) {
        return SType::Continuous;
    }

    if symbol.chars().all(|c| c.is_ascii_digit()) {
        return SType::InstrumentId;
    }

    SType::RawSymbol
}

/// # Errors
///
/// Returns an error if `symbols` is empty or symbols have inconsistent symbology types.
pub fn check_consistent_symbology(symbols: &[&str]) -> anyhow::Result<()> {
    if symbols.is_empty() {
        anyhow::bail!("No symbols provided");
    }
    let first_symbol = symbols[0];
    let first_stype = infer_symbology_type(first_symbol);

    for symbol in symbols {
        let next_stype = infer_symbology_type(symbol);
        if next_stype != first_stype {
            anyhow::bail!(
                "Inconsistent symbology types: '{first_stype}' for {first_symbol} vs '{next_stype}' for {symbol}"
            );
        }
    }

    Ok(())
}

#[cfg(test)]
mod tests {

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Ensure the symbol list is non-empty before calling get_range_*
  2. Check upstream symbol resolution logic for filters that can remove all symbols
  3. Guard the call site with an explicit emptiness check

Example fix

// before
adapter.get_range_trades(&[], stype).await?;
// after
if symbols.is_empty() {
    anyhow::bail!("cannot request trades: no symbols");
}
adapter.get_range_trades(&symbols, stype).await?;
Defensive patterns

Strategy: validation

Validate before calling

if symbols.is_empty() {
    anyhow::bail!("refusing request: symbol list is empty");
}

Type guard

fn has_symbols(symbols: &[&str]) -> bool { !symbols.is_empty() }

Try / catch

match check_consistent_symbology(&symbols) {
    Err(e) if e.to_string().contains("No symbols provided") => {
        warn!("nothing to request");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling any get_range_* function (instruments, quotes, order book depth10/deltas, trades, bars) with an empty symbols slice.

Common situations: Programmatically built symbol lists that end up empty (filtered-out instruments, failed symbol resolution), passing a default-constructed Vec.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/16e7a74efb087c47. Report an issue: GitHub.