Skip to content

Python client: add support for endpoint, sts-endpoint, path-style-access #2127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions client/python/cli/command/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ def options_get(key, f=lambda x: x):
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),
Expand Down
8 changes: 7 additions & 1 deletion client/python/cli/command/catalogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -157,7 +160,7 @@ def validate(self):
)

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
Expand All @@ -175,6 +178,9 @@ def _build_storage_config_info(self):
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(
Expand Down
8 changes: 8 additions & 0 deletions client/python/cli/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,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"
Expand Down Expand Up @@ -222,6 +225,11 @@ class Create:
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 = (
Expand Down
3 changes: 3 additions & 0 deletions client/python/cli/options/option_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ def get_tree() -> List[Option]:
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),
Expand Down