microsoft/qlib · error · ValueError

cannot support {interval}

Error message

cannot support {interval}

What it means

Raised in the crypto collector's validation/download path when interval equals INTERVAL_1d it calls _get_simple, otherwise it delegates 1min to get_data_from_remote via the earlier branch; reaching the final else means interval is neither 1d nor the 1min remote path — an unsupported combination for this collector class.

Source

Thrown at scripts/data_collector/crypto/collector.py:167

            logger.warning(f"{error_msg}:{e}")

    def get_data(
        self, symbol: str, interval: str, start_datetime: pd.Timestamp, end_datetime: pd.Timestamp
    ) -> [pd.DataFrame]:
        def _get_simple(start_, end_):
            self.sleep()
            _remote_interval = interval
            return self.get_data_from_remote(
                symbol,
                interval=_remote_interval,
                start=start_,
                end=end_,
            )

        if interval == self.INTERVAL_1d:
            _result = _get_simple(start_datetime, end_datetime)
        else:
            raise ValueError(f"cannot support {interval}")
        return _result


class CryptoCollector1d(CryptoCollector, ABC):
    def get_instrument_list(self):
        logger.info("get coingecko crypto symbols......")
        symbols = get_cg_crypto_symbols()
        logger.info(f"get {len(symbols)} symbols.")
        return symbols

    def normalize_symbol(self, symbol):
        return symbol

    @property
    def _timezone(self):
        return "Asia/Shanghai"

View on GitHub (pinned to 79633dd950)

Solutions

  1. Use interval=1d or interval=1min with the crypto collector.
  2. If subclassing, ensure your interval handling matches the branch conditions (1min goes through get_data_from_remote; only 1d reaches _get_simple).
  3. For other granularities use the binance-based crypto collector scripts that support them.

Example fix

# before
collector.get_data(symbol, interval="5min", ...)

# after
collector.get_data(symbol, interval="1min", ...)
Defensive patterns

Strategy: validation

Validate before calling

assert interval in ("1d", "1min"), f"unsupported crypto interval: {interval!r}"

Prevention

When it happens

Trigger: Calling get_data (or download loop) with interval not in {1d, 1min} on CryptoCollector, or a subclass where the 1min branch condition (e.g. start/end bounds enabling remote fetch) is not met and a stray interval value falls through to the else.

Common situations: Passing 5min/1h intervals to the crypto collector; subclass overriding conditions such that only the else branch remains reachable; inconsistent interval constants after a refactor (INTERVAL_1min string mismatch with the check above).

Related errors


AI-assisted analysis of microsoft/qlib@79633dd950 (2026-08-15). Data as JSON: /api/errors/0ad3f252b71bd75b. Report an issue: GitHub.