{"record":{"id":"e97708ae530a5ec5","repo":"pola-rs/polars","slug":"invalid-value-for-polars-inflight-sink-morsel-limi","errorCode":null,"errorMessage":"invalid value for POLARS_INFLIGHT_SINK_MORSEL_LIMIT: {x}","messagePattern":"invalid value for POLARS_INFLIGHT_SINK_MORSEL_LIMIT: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-stream/src/nodes/io_sinks/config.rs","lineNumber":33,"sourceCode":"const DEFAULT_PARTITIONED_UPLOAD_CHUNK_SIZE: NonZeroUsize =\n    NonZeroUsize::new(6 * 1024 * 1024).unwrap();\n\npub struct IOSinkNodeConfig {\n    pub file_format: FileWriteFormat,\n    pub target: IOSinkTarget,\n    pub unified_sink_args: UnifiedSinkArgs,\n    pub input_schema: SchemaRef,\n}\n\nimpl IOSinkNodeConfig {\n    pub fn num_pipelines_per_sink(&self, num_pipelines: NonZeroUsize) -> NonZeroUsize {\n        NonZeroUsize::min(num_pipelines, self.inflight_morsel_limit(num_pipelines))\n    }\n\n    pub fn inflight_morsel_limit(&self, num_pipelines: NonZeroUsize) -> NonZeroUsize {\n        if let Ok(v) = std::env::var(\"POLARS_INFLIGHT_SINK_MORSEL_LIMIT\").map(|x| {\n            x.parse::<NonZeroUsize>().unwrap_or_else(|_| {\n                panic!(\"invalid value for POLARS_INFLIGHT_SINK_MORSEL_LIMIT: {x}\")\n            })\n        }) {\n            return v;\n        };\n\n        NonZeroUsize::saturating_add(\n            num_pipelines,\n            // Additional buffer to accommodate head-of-line blocking\n            4,\n        )\n    }\n\n    pub fn max_open_sinks(&self) -> NonZeroUsize {\n        if let Ok(v) = std::env::var(\"POLARS_MAX_OPEN_SINKS\").map(|x| {\n            x.parse::<NonZeroUsize>()\n                .unwrap_or_else(|_| panic!(\"invalid value for POLARS_MAX_OPEN_SINKS: {x}\"))\n        }) {\n            return v;","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/pola-rs/polars/blob/9b5d73fd00236295624374b075d16b1fe6ec6df9/crates/polars-stream/src/nodes/io_sinks/config.rs#L15-L51","documentation":"Panic from IOSinkNodeConfig::inflight_morsel_limit: the POLARS_INFLAT_SINK_MORSEL_LIMIT environment variable was set but could not be parsed as a NonZeroUsize (empty, non-numeric, or zero). The string {x} is the offending raw value.","triggerScenarios":"Environment variable POLARS_INFLIGHT_SINK_MORSEL_LIMIT holds a non-numeric or out-of-range value.","commonSituations":"See trigger scenarios.","solutions":["Set POLARS_INFLIGHT_SINK_MORSEL_LIMIT to a positive integer, or unset it to use the default."],"exampleFix":"export POLARS_INFLIGHT_SINK_MORSEL_LIMIT=16","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b5d73fd00236295624374b075d16b1fe6ec6df9","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":"2026-08-19T12:15:06.350Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}