mattfaltyn opened a new issue, #5146: URL: https://github.com/apache/polaris/issues/5146
### Describe the bug `polaris setup export` silently exports only top-level namespaces. Every nested namespace (for example, `parent.child`) is missing from the generated `catalogs[].namespaces` configuration. Policy definitions in nested namespaces are also missing from `catalogs[].policies`. This makes the exported configuration incomplete and prevents `setup export` followed by `setup apply` from round-tripping a Polaris setup. The export still exits successfully and does not warn that namespaces or policy definitions were skipped, so the result can be mistaken for a complete backup. This is separate from the documented omission of policy attachments. ### To Reproduce 1. Create a catalog named `example`. 2. Create a top-level namespace named `parent`. 3. Create a nested namespace named `parent.child`. 4. Create a policy in `parent.child`. 5. Run `polaris setup export > setup.yaml`. 6. Inspect the `namespaces` and `policies` entries for the `example` catalog. The repository integration test also demonstrates the relevant API behavior: listing namespaces without `parent` returns only top-level namespaces, while listing with `parent="NS1"` returns that namespace's direct children: https://github.com/apache/polaris/blob/bbce5529bfe99106d45b19d282bd2c9293d7ab17/client/python/integration_tests/test_catalog_apis.py#L58-L79 ### Actual Behavior The export contains `parent`, but omits `parent.child` and the policy defined in `parent.child`. The command completes successfully without reporting the omitted entities. Both export paths enumerate namespaces only once at the catalog root: - Namespace export: https://github.com/apache/polaris/blob/bbce5529bfe99106d45b19d282bd2c9293d7ab17/client/python/apache_polaris/cli/command/setup.py#L423-L452 - Policy export: https://github.com/apache/polaris/blob/bbce5529bfe99106d45b19d282bd2c9293d7ab17/client/python/apache_polaris/cli/command/setup.py#L454-L498 Neither path recursively calls `list_namespaces(..., parent=...)`, so descendants never enter the namespace or policy export loops. ### Expected Behavior `polaris setup export` should recursively export every namespace at every depth and every policy definition in those namespaces. Applying the exported configuration should reconstruct the complete namespace hierarchy and its policies. The CLI already contains a breadth-first namespace traversal helper that may be reusable: https://github.com/apache/polaris/blob/bbce5529bfe99106d45b19d282bd2c9293d7ab17/client/python/apache_polaris/cli/command/utils.py#L156-L225 A regression test should include at least a two-level namespace and a policy in the child namespace. ### Additional context Verified against current `upstream/main` at `bbce5529bfe99106d45b19d282bd2c9293d7ab17`. Before filing, I searched open and closed issues and pull requests, their descriptions and discussion comments, and the relevant pull-request review comments. I did not find an existing report or fix for this root cause. Related work on nested namespace handling in `setup apply` does not change export traversal. ### System information OS: macOS Darwin 25.5.0 arm64 Polaris Catalog Version: `main` at `bbce5529bfe99106d45b19d282bd2c9293d7ab17` Object storage & setup: Not storage-specific; the omission occurs while enumerating catalog namespaces during CLI export. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
