{"record":{"id":"bc746701521ac497","repo":"pola-rs/polars","slug":"invalid-value-for-polars-partitioned-upload-chunk","errorCode":null,"errorMessage":"invalid value for POLARS_PARTITIONED_UPLOAD_CHUNK_SIZE: {s}","messagePattern":"invalid value for POLARS_PARTITIONED_UPLOAD_CHUNK_SIZE: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-io/src/configs.rs","lineNumber":16,"sourceCode":"use std::num::NonZeroUsize;\nuse std::sync::LazyLock;\n\npub fn env_upload_chunk_size() -> Option<NonZeroUsize> {\n    std::env::var(\"POLARS_UPLOAD_CHUNK_SIZE\").ok().map(|s| {\n        s.parse::<NonZeroUsize>()\n            .unwrap_or_else(|_| panic!(\"invalid value for POLARS_UPLOAD_CHUNK_SIZE: {s}\"))\n    })\n}\n\npub fn env_partitioned_upload_chunk_size() -> Option<NonZeroUsize> {\n    std::env::var(\"POLARS_PARTITIONED_UPLOAD_CHUNK_SIZE\")\n        .ok()\n        .map(|s| {\n            s.parse::<NonZeroUsize>().unwrap_or_else(|_| {\n                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}\")","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/pola-rs/polars/blob/9b5d73fd00236295624374b075d16b1fe6ec6df9/crates/polars-io/src/configs.rs#L1-L34","documentation":"Panics in env_partitioned_upload_chunk_size() when POLARS_PARTITIONED_UPLOAD_CHUNK_SIZE is set to a value that does not parse as a NonZeroUsize. It is a startup-time env validation guard for the partitioned-upload part size; leaving the variable unset is fine.","triggerScenarios":"This panic/expect fires when execution reaches an unguarded state described by: \"invalid value for POLARS_PARTITIONED_UPLOAD_CHUNK_SIZE: {s}\". 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.","commonSituations":"Encountered when input data or configuration does not meet the preconditions of the throwing code path (\"invalid value for POLARS_PARTITIONED_UPLOAD_CHUNK_SIZE: {s}\"). 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.","solutions":["Set POLARS_PARTITIONED_UPLOAD_CHUNK_SIZE to a valid positive integer (bytes).","Unset the variable to use the default partitioned upload chunk size."],"exampleFix":null,"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"}