This is an automated email from the ASF dual-hosted git repository. snazy pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/polaris.git
The following commit(s) were added to refs/heads/main by this push: new 3316f4ed3 Python client: add support for endpoint, sts-endpoint, path-style-access (#2127) 3316f4ed3 is described below commit 3316f4ed392e81e6b32c675e7cbbe8bb9ebca488 Author: Robert Stupp <sn...@snazy.de> AuthorDate: Mon Jul 21 13:02:49 2025 +0200 Python client: add support for endpoint, sts-endpoint, path-style-access (#2127) This change adds support for endpoint, sts-endpoint, path-style-access to the Polaris Python client. Amends #1913 and #2012 --- client/python/cli/command/__init__.py | 3 +++ client/python/cli/command/catalogs.py | 8 +++++++- client/python/cli/constants.py | 8 ++++++++ client/python/cli/options/option_tree.py | 3 +++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/client/python/cli/command/__init__.py b/client/python/cli/command/__init__.py index 46fe2d49b..659a9b9e2 100644 --- a/client/python/cli/command/__init__.py +++ b/client/python/cli/command/__init__.py @@ -65,6 +65,9 @@ class Command(ABC): hadoop_warehouse=options_get(Arguments.HADOOP_WAREHOUSE), iceberg_remote_catalog_name=options_get(Arguments.ICEBERG_REMOTE_CATALOG_NAME), remove_properties=[] if remove_properties is None else remove_properties, + endpoint=options_get(Arguments.ENDPOINT), + sts_endpoint=options_get(Arguments.STS_ENDPOINT), + path_style_access=options_get(Arguments.PATH_STYLE_ACCESS), catalog_connection_type=options_get(Arguments.CATALOG_CONNECTION_TYPE), catalog_authentication_type=options_get(Arguments.CATALOG_AUTHENTICATION_TYPE), catalog_service_identity_type=options_get(Arguments.CATALOG_SERVICE_IDENTITY_TYPE), diff --git a/client/python/cli/command/catalogs.py b/client/python/cli/command/catalogs.py index 432ae1cab..3708bb5d6 100644 --- a/client/python/cli/command/catalogs.py +++ b/client/python/cli/command/catalogs.py @@ -64,6 +64,9 @@ class CatalogsCommand(Command): remove_properties: List[str] hadoop_warehouse: str iceberg_remote_catalog_name: str + endpoint: str + sts_endpoint: str + path_style_access: bool catalog_connection_type: str catalog_authentication_type: str catalog_service_identity_type: str @@ -161,7 +164,7 @@ class CatalogsCommand(Command): ) def _has_aws_storage_info(self): - return self.role_arn or self.external_id or self.user_arn or self.region + return self.role_arn or self.external_id or self.user_arn or self.region or self.endpoint or self.sts_endpoint or self.path_style_access def _has_azure_storage_info(self): return self.tenant_id or self.multi_tenant_app_name or self.consent_url @@ -179,6 +182,9 @@ class CatalogsCommand(Command): external_id=self.external_id, user_arn=self.user_arn, region=self.region, + endpoint=self.endpoint, + sts_endpoint=self.sts_endpoint, + path_style_access=self.path_style_access, ) elif self.storage_type == StorageType.AZURE.value: config = AzureStorageConfigInfo( diff --git a/client/python/cli/constants.py b/client/python/cli/constants.py index 6b92c4d90..331741a29 100644 --- a/client/python/cli/constants.py +++ b/client/python/cli/constants.py @@ -166,6 +166,9 @@ class Arguments: PROXY = "proxy" HADOOP_WAREHOUSE = "hadoop_warehouse" ICEBERG_REMOTE_CATALOG_NAME = "iceberg_remote_catalog_name" + ENDPOINT = "endpoint" + STS_ENDPOINT = "sts_endpoint" + PATH_STYLE_ACCESS = "path_style_access" CATALOG_CONNECTION_TYPE = "catalog_connection_type" CATALOG_AUTHENTICATION_TYPE = "catalog_authentication_type" CATALOG_SERVICE_IDENTITY_TYPE = "catalog_service_identity_type" @@ -223,6 +226,11 @@ class Hints: EXTERNAL_ID = "(Only for S3) The external ID to use when connecting to S3" REGION = "(Only for S3) The region to use when connecting to S3" USER_ARN = "(Only for S3) A user ARN to use when connecting to S3" + ENDPOINT = "(Only for S3) The S3 endpoint to use when connecting to S3" + STS_ENDPOINT = ( + "(Only for S3) The STS endpoint to use when connecting to STS" + ) + PATH_STYLE_ACCESS = "(Only for S3) Whether to use path-style-access for S3" TENANT_ID = "(Required for Azure) A tenant ID to use when connecting to Azure Storage" MULTI_TENANT_APP_NAME = ( diff --git a/client/python/cli/options/option_tree.py b/client/python/cli/options/option_tree.py index d8db86899..7b10a64ea 100644 --- a/client/python/cli/options/option_tree.py +++ b/client/python/cli/options/option_tree.py @@ -116,6 +116,9 @@ class OptionTree: Argument(Arguments.STORAGE_TYPE, str, Hints.Catalogs.Create.STORAGE_TYPE, lower=True, choices=[st.value for st in StorageType]), Argument(Arguments.DEFAULT_BASE_LOCATION, str, Hints.Catalogs.Create.DEFAULT_BASE_LOCATION), + Argument(Arguments.ENDPOINT, str, Hints.Catalogs.Create.ENDPOINT), + Argument(Arguments.STS_ENDPOINT, str, Hints.Catalogs.Create.STS_ENDPOINT), + Argument(Arguments.PATH_STYLE_ACCESS, bool, Hints.Catalogs.Create.PATH_STYLE_ACCESS), Argument(Arguments.ALLOWED_LOCATION, str, Hints.Catalogs.Create.ALLOWED_LOCATION, allow_repeats=True), Argument(Arguments.ROLE_ARN, str, Hints.Catalogs.Create.ROLE_ARN),