{"record":{"id":"9140a7ea2a9a7774","repo":"pola-rs/polars","slug":"invalid-value-for-polars-lines-chunk-prefetch-limi","errorCode":null,"errorMessage":"invalid value for POLARS_LINES_CHUNK_PREFETCH_LIMIT: {x}","messagePattern":"invalid value for POLARS_LINES_CHUNK_PREFETCH_LIMIT: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-stream/src/nodes/io_sources/lines.rs","lineNumber":52,"sourceCode":"}\n\nimpl FileReaderBuilder for LineReaderBuilder {\n    fn reader_name(&self) -> &str {\n        \"line\"\n    }\n\n    fn reader_capabilities(&self) -> ReaderCapabilities {\n        ndjson_reader_capabilities()\n    }\n\n    fn set_execution_state(&self, execution_state: &crate::execute::StreamingExecutionState) {\n        // The maximum number of chunks actively being prefetched at any point in time.\n        let prefetch_limit = std::env::var(\"POLARS_LINES_CHUNK_PREFETCH_LIMIT\")\n            .map(|x| {\n                x.parse::<NonZeroUsize>()\n                    .ok()\n                    .unwrap_or_else(|| {\n                        panic!(\"invalid value for POLARS_LINES_CHUNK_PREFETCH_LIMIT: {x}\")\n                    })\n                    .get()\n            })\n            .unwrap_or(execution_state.num_pipelines.saturating_mul(2))\n            .max(1);\n\n        self.prefetch_limit.store(prefetch_limit);\n\n        if config::verbose() {\n            eprintln!(\n                \"[LineReaderBuilder]: prefetch_limit: {}\",\n                self.prefetch_limit.load()\n            );\n        }\n\n        self.prefetch_semaphore\n            .set(Arc::new(tokio::sync::Semaphore::new(prefetch_limit)))\n            .unwrap()","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/pola-rs/polars/blob/9b5d73fd00236295624374b075d16b1fe6ec6df9/crates/polars-stream/src/nodes/io_sources/lines.rs#L34-L70","documentation":"Panic in LineReaderBuilder::set_execution_state: POLARS_LINES_CHUNK_PREFETCH_LIMIT was set but cannot be parsed as a NonZeroUsize. Because the env var is meant to override the default line-reader chunk prefetch count, the malformed value {x} stops the streaming read from starting.","triggerScenarios":"Invalid value in POLARS_LINES_CHUNK_PREFETCH_LIMIT.","commonSituations":"See trigger scenarios.","solutions":["Set POLARS_LINES_CHUNK_PREFETCH_LIMIT to a positive integer or unset it."],"exampleFix":"export POLARS_LINES_CHUNK_PREFETCH_LIMIT=4","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"}