{"record":{"id":"05ac03f8bc07af9b","repo":"pola-rs/polars","slug":"invalid-value-for-polars-partitioned-upload-concur","errorCode":null,"errorMessage":"invalid value for POLARS_PARTITIONED_UPLOAD_CONCURRENCY: {s}","messagePattern":"invalid value for POLARS_PARTITIONED_UPLOAD_CONCURRENCY: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-io/src/configs.rs","lineNumber":34,"sourceCode":"                panic!(\"invalid value for POLARS_PARTITIONED_UPLOAD_CHUNK_SIZE: {s}\")\n            })\n        })\n}\n\n/// Max concurrent tasks within a single cloud writer.\npub fn env_upload_concurrency() -> Option<NonZeroUsize> {\n    std::env::var(\"POLARS_UPLOAD_CONCURRENCY\").ok().map(|s| {\n        s.parse::<NonZeroUsize>()\n            .unwrap_or_else(|_| panic!(\"invalid value for POLARS_UPLOAD_CONCURRENCY: {s}\"))\n    })\n}\n\npub fn env_partitioned_upload_concurrency() -> Option<NonZeroUsize> {\n    std::env::var(\"POLARS_PARTITIONED_UPLOAD_CONCURRENCY\")\n        .ok()\n        .map(|s| {\n            s.parse::<NonZeroUsize>().unwrap_or_else(|_| {\n                panic!(\"invalid value for POLARS_PARTITIONED_UPLOAD_CONCURRENCY: {s}\")\n            })\n        })\n}\n\n/// Runs of this many values whose total bytes are <= `copy_buffer_reserve_size` will be copied into\n/// a single contiguous chunk.\npub(crate) fn cloud_writer_coalesce_run_length() -> usize {\n    return *COALESCE_RUN_LENGTH;\n\n    static COALESCE_RUN_LENGTH: LazyLock<usize> = LazyLock::new(|| {\n        let mut v: usize = 64;\n\n        if let Ok(s) = std::env::var(\"POLARS_CLOUD_WRITER_COALESCE_RUN_LENGTH\") {\n            v = s\n                .parse::<usize>()\n                .ok()\n                .filter(|x| *x >= 2)\n                .unwrap_or_else(|| {","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/crates/polars-io/src/configs.rs#L16-L52","documentation":"This panic is raised when POLARS_PARTITIONED_UPLOAD_CONCURRENCY is present but cannot be parsed as a non-zero usize. It limits concurrent tasks per partition within Polars' partitioned cloud writers. An unparseable or zero value panics because the env var, when set, is treated as authoritative configuration.","triggerScenarios":"export POLARS_PARTITIONED_UPLOAD_CONCURRENCY=0, 'abc', '1.5', '-2', or empty; triggered when a partitioned cloud writer reads its concurrency settings via env_partitioned_upload_concurrency.","commonSituations":"Misunderstanding that 0 means unlimited; copying values with unit suffixes; drift between documentation and accepted format; Kubernetes ConfigMap injecting an empty string.","solutions":["Set the variable to a plain positive integer or delete it to use the default","Cross-check that you did not mean POLARS_UPLOAD_CONCURRENCY (non-partitioned variant)","Validate numeric env vars in CI before deploying (e.g. a regex check ^[1-9][0-9]*$)"],"exampleFix":"// before\nPOLARS_PARTITIONED_UPLOAD_CONCURRENCY=1.5\n// after\nPOLARS_PARTITIONED_UPLOAD_CONCURRENCY=4","handlingStrategy":"validation","validationCode":"const v = process.env.POLARS_PARTITIONED_UPLOAD_CONCURRENCY;\nif (v !== undefined && !/^[0-9]+$/.test(v.trim())) throw new Error(`POLARS_PARTITIONED_UPLOAD_CONCURRENCY must be a positive integer, got: ${v}`);","typeGuard":"function isValidConcurrency(v) { return typeof v === 'string' && /^[1-9][0-9]*$/.test(v.trim()); }","tryCatchPattern":"// validate before process start; panic is fatal\nconst raw = process.env.POLARS_PARTITIONED_UPLOAD_CONCURRENCY;\nif (raw && !/^\\d+$/.test(raw.trim())) { console.error('invalid POLARS_PARTITIONED_UPLOAD_CONCURRENCY'); process.exit(2); }","preventionTips":["Use integers >= 1 only","Kubernetes/ConfigMap: ensure values are non-empty strings of digits","Do not confuse with POLARS_UPLOAD_CONCURRENCY","Add a startup env lint step"],"tags":["env-var","configuration","panic","concurrency"],"backgroundTag":"invalid-env-var-value","analyzedSha":"fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e","analyzedAt":"2026-09-18T22:14:11.667Z","contentChangedAt":"2026-09-18T22:14:11.667Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}