From c1bd9ed1e19be70dcefa2244c574ad93b8db8e24 Mon Sep 17 00:00:00 2001 From: Nuoya Jiang Date: Wed, 15 Oct 2025 21:02:08 -0500 Subject: [PATCH 1/4] fix typo --- site/content/in-dev/unreleased/command-line-interface.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/content/in-dev/unreleased/command-line-interface.md b/site/content/in-dev/unreleased/command-line-interface.md index 2c7c26563e..c455ec80f2 100644 --- a/site/content/in-dev/unreleased/command-line-interface.md +++ b/site/content/in-dev/unreleased/command-line-interface.md @@ -156,7 +156,7 @@ options: --consent-url (Only for Azure) A consent URL granting permissions for the Azure Storage location --service-account (Only for GCS) The service account to use when connecting to GCS --property A key/value pair such as: tag=value. Multiple can be provided by specifying this option more than once - --catalog-connection-type The type of external catalog in [ICEBERG, HADOOP]. + --catalog-connection-type The type of external catalog in [iceberg-rest, hadoop]. --iceberg-remote-catalog-name The remote catalog name when federating to an Iceberg REST catalog --hadoop-warehouse The warehouse to use when federating to a HADOOP catalog --catalog-authentication-type The type of authentication in [OAUTH, BEARER, SIGV4, IMPLICIT] From 6b9605420d6a4e5711ff16075019b831de5a4ebe Mon Sep 17 00:00:00 2001 From: Nuoya Jiang Date: Thu, 16 Oct 2025 23:12:40 -0500 Subject: [PATCH 2/4] added test for policy catalog --- .../integration_tests/test_catalog_apis.py | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/client/python/integration_tests/test_catalog_apis.py b/client/python/integration_tests/test_catalog_apis.py index 214329a069..1fa2454c0a 100644 --- a/client/python/integration_tests/test_catalog_apis.py +++ b/client/python/integration_tests/test_catalog_apis.py @@ -271,6 +271,41 @@ def test_policies( assert updated_policy.policy.description == updated_policy_description assert json.loads(updated_policy.policy.content) == updated_policy_content + # ATTACH to catalog + test_policy_api.attach_policy( + prefix=test_catalog.name, + namespace=namespace_name, + policy_name=policy_name, + attach_policy_request=AttachPolicyRequest( + target=PolicyAttachmentTarget(type="catalog", path=[]) + ), + ) + + # GET APPLICABLE on catalog + applicable_policies = test_policy_api.get_applicable_policies( + prefix=test_catalog.name + ) + + assert len(applicable_policies.applicable_policies) == 1 + assert applicable_policies.applicable_policies[0].name == policy_name + + # DETACH from catalog + test_policy_api.detach_policy( + prefix=test_catalog.name, + namespace=namespace_name, + policy_name=policy_name, + detach_policy_request=DetachPolicyRequest( + target=PolicyAttachmentTarget(type="catalog", path=[]) + ), + ) + + # GET APPLICABLE on catalog after DETACH + applicable_policies = test_policy_api.get_applicable_policies( + prefix=test_catalog.name + ) + + assert len(applicable_policies.applicable_policies) == 0 + # ATTACH to namespace test_policy_api.attach_policy( prefix=test_catalog.name, From 5d8ddac8c5fb34a179222a0c436a3bfa785e1ef0 Mon Sep 17 00:00:00 2001 From: Nuoya Jiang Date: Thu, 16 Oct 2025 23:33:46 -0500 Subject: [PATCH 3/4] added inheritance test and polish variable names in test_policies --- .../integration_tests/test_catalog_apis.py | 40 ++++++++++++------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/client/python/integration_tests/test_catalog_apis.py b/client/python/integration_tests/test_catalog_apis.py index 1fa2454c0a..1cfe449506 100644 --- a/client/python/integration_tests/test_catalog_apis.py +++ b/client/python/integration_tests/test_catalog_apis.py @@ -277,17 +277,27 @@ def test_policies( namespace=namespace_name, policy_name=policy_name, attach_policy_request=AttachPolicyRequest( - target=PolicyAttachmentTarget(type="catalog", path=[]) + target=PolicyAttachmentTarget(type="catalog") ), ) # GET APPLICABLE on catalog - applicable_policies = test_policy_api.get_applicable_policies( + applicable_policies_catalog = test_policy_api.get_applicable_policies( prefix=test_catalog.name ) - assert len(applicable_policies.applicable_policies) == 1 - assert applicable_policies.applicable_policies[0].name == policy_name + assert len(applicable_policies_catalog.applicable_policies) == 1 + assert applicable_policies_catalog.applicable_policies[0].name == policy_name + + # GET inherited APPLICABLE policies on table + applicable_for_table_inherit = test_policy_api.get_applicable_policies( + prefix=test_catalog.name, + namespace=format_namespace(sub_namespace_path), + target_name=table_name, + ) + assert len(applicable_for_table_inherit.applicable_policies) == 1 + assert applicable_for_table_inherit.applicable_policies[0].name == policy_name + assert applicable_for_table_inherit.applicable_policies[0].inherited # DETACH from catalog test_policy_api.detach_policy( @@ -295,16 +305,16 @@ def test_policies( namespace=namespace_name, policy_name=policy_name, detach_policy_request=DetachPolicyRequest( - target=PolicyAttachmentTarget(type="catalog", path=[]) + target=PolicyAttachmentTarget(type="catalog") ), ) # GET APPLICABLE on catalog after DETACH - applicable_policies = test_policy_api.get_applicable_policies( - prefix=test_catalog.name + applicable_policies_catalog_after_detach = ( + test_policy_api.get_applicable_policies(prefix=test_catalog.name) ) - assert len(applicable_policies.applicable_policies) == 0 + assert len(applicable_policies_catalog_after_detach.applicable_policies) == 0 # ATTACH to namespace test_policy_api.attach_policy( @@ -317,11 +327,11 @@ def test_policies( ) # GET APPLICABLE on namespace - applicable_policies = test_policy_api.get_applicable_policies( + applicable_policies_namespace = test_policy_api.get_applicable_policies( prefix=test_catalog.name, namespace=format_namespace(sub_namespace_path) ) - assert len(applicable_policies.applicable_policies) == 1 - assert applicable_policies.applicable_policies[0].name == policy_name + assert len(applicable_policies_namespace.applicable_policies) == 1 + assert applicable_policies_namespace.applicable_policies[0].name == policy_name # DETACH from namespace test_policy_api.detach_policy( @@ -334,10 +344,12 @@ def test_policies( ) # GET APPLICABLE on namespace after DETACH - applicable_policies_after_detach = test_policy_api.get_applicable_policies( - prefix=test_catalog.name, namespace=format_namespace(sub_namespace_path) + applicable_policies_namespace_after_detach = ( + test_policy_api.get_applicable_policies( + prefix=test_catalog.name, namespace=format_namespace(sub_namespace_path) + ) ) - assert len(applicable_policies_after_detach.applicable_policies) == 0 + assert len(applicable_policies_namespace_after_detach.applicable_policies) == 0 # ATTACH to table test_policy_api.attach_policy( From c9565d8c576610c3cc74d518ae6b43ddff517e16 Mon Sep 17 00:00:00 2001 From: Nuoya Jiang Date: Thu, 16 Oct 2025 23:41:30 -0500 Subject: [PATCH 4/4] fixed comment --- client/python/integration_tests/test_catalog_apis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/python/integration_tests/test_catalog_apis.py b/client/python/integration_tests/test_catalog_apis.py index 1cfe449506..25695b147b 100644 --- a/client/python/integration_tests/test_catalog_apis.py +++ b/client/python/integration_tests/test_catalog_apis.py @@ -289,7 +289,7 @@ def test_policies( assert len(applicable_policies_catalog.applicable_policies) == 1 assert applicable_policies_catalog.applicable_policies[0].name == policy_name - # GET inherited APPLICABLE policies on table + # GET inherited APPLICABLE on table applicable_for_table_inherit = test_policy_api.get_applicable_policies( prefix=test_catalog.name, namespace=format_namespace(sub_namespace_path),