{"record":{"id":"6797ead9d397ddc7","repo":"pola-rs/polars","slug":"feature-cloud-must-be-enabled-to-use-globbing-patterns-with","errorCode":null,"errorMessage":"Feature `cloud` must be enabled to use globbing patterns with cloud urls.","messagePattern":"Feature `cloud` must be enabled to use globbing patterns with cloud urls\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-io/src/path_utils/mod.rs","lineNumber":541,"sourceCode":"                        first_path_has_scheme,\n                    )\n                    .await?;\n                    for (p, size) in paths {\n                        if let Some(size) = size {\n                            sizes_by_path.insert(p.clone(), size);\n                        }\n                        out_paths.push(p);\n                    }\n                    hive_idx_tracker.update(expand_start_idx, path_idx)?;\n                };\n\n                if let Some(mut_slice) = out_paths.paths.get_mut(sort_start_idx..) {\n                    <[PlRefPath]>::sort_unstable(mut_slice);\n                }\n            }\n        }\n        #[cfg(not(feature = \"cloud\"))]\n        panic!(\"Feature `cloud` must be enabled to use globbing patterns with cloud urls.\")\n    } else {\n        let mut stack: VecDeque<Cow<'_, Path>> = VecDeque::new();\n        let mut paths_scratch: Vec<PathBuf> = vec![];\n\n        for (path_idx, path) in paths.iter().enumerate() {\n            stack.clear();\n            let sort_start_idx = out_paths.paths.len();\n\n            if path.as_std_path().is_dir() {\n                let i = path.as_str().len();\n\n                hive_idx_tracker.update(i, path_idx)?;\n\n                stack.push_back(Cow::Borrowed(path.as_std_path()));\n\n                while let Some(dir) = stack.pop_front() {\n                    let mut last_err = Ok(());\n","sourceCodeStart":523,"sourceCodeEnd":559,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/crates/polars-io/src/path_utils/mod.rs#L523-L559","documentation":"expand_paths_hive panics when a globbing pattern (e.g. s3://bucket/data/*.parquet) is used with a cloud URL but the polars 'cloud' feature is disabled, since cloud path expansion requires that feature. The library deliberately aborts instead of silently mis-expanding.","triggerScenarios":"Calling expand_paths / expand_paths_hive (directly or via scan/read functions) with a glob pattern in a cloud scheme URL (s3://, gs://, azure://...) on a polars build compiled without feature = \"cloud\".","commonSituations":"Using prebuilt polars wheels/binaries without the cloud feature while scanning wildcards on S3/GCS/Azure; upgrading polars and losing the feature flag in Cargo.toml.","solutions":["Enable the cloud feature: polars = { version = \"...\", features = [\"cloud\"] } in Cargo.toml.","Remove the wildcard and pass explicit object paths instead (list files yourself via the cloud SDK).","Use local paths for globbing if cloud access is not actually required."],"exampleFix":"// before\npolars = { version = \"0.46\", features = [\"lazy\"] }\n// after\npolars = { version = \"0.46\", features = [\"lazy\", \"cloud\"] }","handlingStrategy":"validation","validationCode":"fn is_cloud_glob(path: &str) -> bool {\n    (path.starts_with(\"s3://\") || path.starts_with(\"gs://\") || path.starts_with(\"az://\") || path.starts_with(\"azure://\"))\n        && path.chars().any(|c| c == '*' || c == '?' || c == '[')\n}\nassert!(!paths.iter().any(is_cloud_glob), \"cloud globbing needs the 'cloud' feature\");","typeGuard":null,"tryCatchPattern":"// It's a panic, not a Result; pre-validate inputs before calling expand_paths\nif is_cloud_glob(&url) {\n    // list objects via cloud SDK instead, or compile with the cloud feature\n}","preventionTips":["Enable features = [\"cloud\"] whenever any scan path may point at object storage","Enumerate cloud object lists with the SDK and pass explicit paths when globbing isn't available","Add a startup check that maps intended inputs to required features in CI"],"tags":["cloud","globbing","feature-flag","panic"],"backgroundTag":"feature-not-enabled","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"}