pola-rs/polars · error
invalid value for {name}: {x}
Error message
invalid value for {name}: {x} What it means
Environment-variable parsing guard in the HTTP rate-limit configuration (parse_env_var): the value read from a POLARS_CLOUD_* env var (e.g. POLARS_CLOUD_CEILING_RATE or POLARS_CLOUD_RATE_HORIZON_MS) cannot be parsed as the expected numeric type. The env var name and raw value are the faulty input.
Source
Thrown at crates/polars-io/src/cloud/http_rate_limit.rs:201
floor_rate
},
ceiling_rate: parse_env_var(DEFAULT_CEILING_RATE, "POLARS_CLOUD_CEILING_RATE"),
horizon: Duration::from_millis(parse_env_var(
DEFAULT_RATE_HORIZON_MS,
"POLARS_CLOUD_RATE_HORIZON_MS",
)),
max_wait: Duration::from_millis(parse_env_var(
DEFAULT_RATE_MAX_WAIT_MS,
"POLARS_CLOUD_RATE_MAX_WAIT_MS",
)),
init_policy: InitPolicy::Inherit,
});
fn parse_env_var<T: FromStr>(default: T, name: &'static str) -> T {
std::env::var(name).map_or(default, |x| {
x.parse::<T>()
.ok()
.unwrap_or_else(|| panic!("invalid value for {name}: {x}"))
})
}
}
}
/// Read-only view of the pacing budget including the learned rate-limit signal
/// for internal consumers (e.g., ConcurrencyController).
/// The cells contains learned rates (f64 bits in an AtomicU64), and are updated
/// by the AIMD loop only.
/// Valid for the process lifetime: object store rebuilds can rotate behind the
/// cells rather than replacing them.
#[derive(Debug, Clone)]
pub struct PacingBudget {
rate_bits: RateCell,
horizon: Duration,
}
impl PacingBudget {View on GitHub (pinned to 68506541d2)
Solutions
- Set the named rate-limit environment variable to a valid positive number.
- Unset the variable to use the default HTTP rate limit.
Defensive patterns
Strategy: validation
When it happens
Trigger: This panic/expect fires when execution reaches an unguarded state described by: "invalid value for {name}: {x}". Typical triggers: unsupported dtype or feature-gated code path reached at runtime, invalid user input or environment variable value, calling API methods in the wrong order or on mismatched types, or data (lengths, offsets, ranges) violating the function's preconditions.
Common situations: Encountered when input data or configuration does not meet the preconditions of the throwing code path ("invalid value for {name}: {x}"). Common cases: missing Cargo feature flags, mismatched dtypes/lengths between arrays or series, out-of-range temporal values, malformed environment variables, or operations on unsupported/complex nested types.
AI-assisted analysis of pola-rs/polars@68506541d2 (2026-08-19).
Data as JSON: /api/errors/f302f1605d46f5fc.
Report an issue: GitHub.