Skip to content

Commit 8f906a6

Browse files
authored
Re-add missing parameters to create_table python API (#1778)
It looks like this method lost the `prefix` and `namespace` parameters in #1347. They're re-introduced to the spec here, and then I've run: ``` redocly bundle spec/polaris-catalog-service.yaml -o spec/generated/bundled-polaris-catalog-service.yaml ./gradlew regeneratePythonClient ``` Then, some manual reverts: ``` alias gitrevert='git checkout upstream/main --' gitrevert client/python/.github/workflows/python.yml gitrevert client/python/.gitlab-ci.yml gitrevert client/python/pyproject.toml ``` I still hope to automate this process as part of CI soon; see #1675
1 parent dd987b6 commit 8f906a6

File tree

4 files changed

+40
-2
lines changed

4 files changed

+40
-2
lines changed

client/python/docs/IcebergCatalogAPI.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ Name | Type | Description | Notes
328328
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
329329

330330
# **create_table**
331-
> LoadTableResult create_table(create_table_request, x_iceberg_access_delegation=x_iceberg_access_delegation)
331+
> LoadTableResult create_table(prefix, namespace, create_table_request, x_iceberg_access_delegation=x_iceberg_access_delegation)
332332
333333
Create a table in the given namespace
334334

@@ -368,12 +368,14 @@ configuration = polaris.catalog.Configuration(
368368
with polaris.catalog.ApiClient(configuration) as api_client:
369369
# Create an instance of the API class
370370
api_instance = polaris.catalog.IcebergCatalogAPI(api_client)
371+
prefix = 'prefix_example' # str | An optional prefix in the path
372+
namespace = 'accounting' # str | A namespace identifier as a single string. Multipart namespace parts should be separated by the unit separator (`0x1F`) byte.
371373
create_table_request = polaris.catalog.CreateTableRequest() # CreateTableRequest |
372374
x_iceberg_access_delegation = 'vended-credentials,remote-signing' # str | Optional signal to the server that the client supports delegated access via a comma-separated list of access mechanisms. The server may choose to supply access via any or none of the requested mechanisms. Specific properties and handling for `vended-credentials` is documented in the `LoadTableResult` schema section of this spec document. The protocol and specification for `remote-signing` is documented in the `s3-signer-open-api.yaml` OpenApi spec in the `aws` module. (optional)
373375

374376
try:
375377
# Create a table in the given namespace
376-
api_response = api_instance.create_table(create_table_request, x_iceberg_access_delegation=x_iceberg_access_delegation)
378+
api_response = api_instance.create_table(prefix, namespace, create_table_request, x_iceberg_access_delegation=x_iceberg_access_delegation)
377379
print("The response of IcebergCatalogAPI->create_table:\n")
378380
pprint(api_response)
379381
except Exception as e:
@@ -387,6 +389,8 @@ with polaris.catalog.ApiClient(configuration) as api_client:
387389

388390
Name | Type | Description | Notes
389391
------------- | ------------- | ------------- | -------------
392+
**prefix** | **str**| An optional prefix in the path |
393+
**namespace** | **str**| A namespace identifier as a single string. Multipart namespace parts should be separated by the unit separator (`0x1F`) byte. |
390394
**create_table_request** | [**CreateTableRequest**](CreateTableRequest.md)| |
391395
**x_iceberg_access_delegation** | **str**| Optional signal to the server that the client supports delegated access via a comma-separated list of access mechanisms. The server may choose to supply access via any or none of the requested mechanisms. Specific properties and handling for `vended-credentials` is documented in the `LoadTableResult` schema section of this spec document. The protocol and specification for `remote-signing` is documented in the `s3-signer-open-api.yaml` OpenApi spec in the `aws` module. | [optional]
392396

client/python/polaris/catalog/api/iceberg_catalog_api.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,8 @@ def _create_namespace_serialize(
10401040
@validate_call
10411041
def create_table(
10421042
self,
1043+
prefix: Annotated[StrictStr, Field(description="An optional prefix in the path")],
1044+
namespace: Annotated[StrictStr, Field(description="A namespace identifier as a single string. Multipart namespace parts should be separated by the unit separator (`0x1F`) byte.")],
10431045
create_table_request: CreateTableRequest,
10441046
x_iceberg_access_delegation: Annotated[Optional[StrictStr], Field(description="Optional signal to the server that the client supports delegated access via a comma-separated list of access mechanisms. The server may choose to supply access via any or none of the requested mechanisms. Specific properties and handling for `vended-credentials` is documented in the `LoadTableResult` schema section of this spec document. The protocol and specification for `remote-signing` is documented in the `s3-signer-open-api.yaml` OpenApi spec in the `aws` module. ")] = None,
10451047
_request_timeout: Union[
@@ -1059,6 +1061,10 @@ def create_table(
10591061
10601062
Create a table or start a create transaction, like atomic CTAS. If `stage-create` is false, the table is created immediately. If `stage-create` is true, the table is not created, but table metadata is initialized and returned. The service should prepare as needed for a commit to the table commit endpoint to complete the create transaction. The client uses the returned metadata to begin a transaction. To commit the transaction, the client sends all create and subsequent changes to the table commit route. Changes from the table create operation include changes like AddSchemaUpdate and SetCurrentSchemaUpdate that set the initial table state.
10611063
1064+
:param prefix: An optional prefix in the path (required)
1065+
:type prefix: str
1066+
:param namespace: A namespace identifier as a single string. Multipart namespace parts should be separated by the unit separator (`0x1F`) byte. (required)
1067+
:type namespace: str
10621068
:param create_table_request: (required)
10631069
:type create_table_request: CreateTableRequest
10641070
:param x_iceberg_access_delegation: Optional signal to the server that the client supports delegated access via a comma-separated list of access mechanisms. The server may choose to supply access via any or none of the requested mechanisms. Specific properties and handling for `vended-credentials` is documented in the `LoadTableResult` schema section of this spec document. The protocol and specification for `remote-signing` is documented in the `s3-signer-open-api.yaml` OpenApi spec in the `aws` module.
@@ -1086,6 +1092,8 @@ def create_table(
10861092
""" # noqa: E501
10871093

10881094
_param = self._create_table_serialize(
1095+
prefix=prefix,
1096+
namespace=namespace,
10891097
create_table_request=create_table_request,
10901098
x_iceberg_access_delegation=x_iceberg_access_delegation,
10911099
_request_auth=_request_auth,
@@ -1119,6 +1127,8 @@ def create_table(
11191127
@validate_call
11201128
def create_table_with_http_info(
11211129
self,
1130+
prefix: Annotated[StrictStr, Field(description="An optional prefix in the path")],
1131+
namespace: Annotated[StrictStr, Field(description="A namespace identifier as a single string. Multipart namespace parts should be separated by the unit separator (`0x1F`) byte.")],
11221132
create_table_request: CreateTableRequest,
11231133
x_iceberg_access_delegation: Annotated[Optional[StrictStr], Field(description="Optional signal to the server that the client supports delegated access via a comma-separated list of access mechanisms. The server may choose to supply access via any or none of the requested mechanisms. Specific properties and handling for `vended-credentials` is documented in the `LoadTableResult` schema section of this spec document. The protocol and specification for `remote-signing` is documented in the `s3-signer-open-api.yaml` OpenApi spec in the `aws` module. ")] = None,
11241134
_request_timeout: Union[
@@ -1138,6 +1148,10 @@ def create_table_with_http_info(
11381148
11391149
Create a table or start a create transaction, like atomic CTAS. If `stage-create` is false, the table is created immediately. If `stage-create` is true, the table is not created, but table metadata is initialized and returned. The service should prepare as needed for a commit to the table commit endpoint to complete the create transaction. The client uses the returned metadata to begin a transaction. To commit the transaction, the client sends all create and subsequent changes to the table commit route. Changes from the table create operation include changes like AddSchemaUpdate and SetCurrentSchemaUpdate that set the initial table state.
11401150
1151+
:param prefix: An optional prefix in the path (required)
1152+
:type prefix: str
1153+
:param namespace: A namespace identifier as a single string. Multipart namespace parts should be separated by the unit separator (`0x1F`) byte. (required)
1154+
:type namespace: str
11411155
:param create_table_request: (required)
11421156
:type create_table_request: CreateTableRequest
11431157
:param x_iceberg_access_delegation: Optional signal to the server that the client supports delegated access via a comma-separated list of access mechanisms. The server may choose to supply access via any or none of the requested mechanisms. Specific properties and handling for `vended-credentials` is documented in the `LoadTableResult` schema section of this spec document. The protocol and specification for `remote-signing` is documented in the `s3-signer-open-api.yaml` OpenApi spec in the `aws` module.
@@ -1165,6 +1179,8 @@ def create_table_with_http_info(
11651179
""" # noqa: E501
11661180

11671181
_param = self._create_table_serialize(
1182+
prefix=prefix,
1183+
namespace=namespace,
11681184
create_table_request=create_table_request,
11691185
x_iceberg_access_delegation=x_iceberg_access_delegation,
11701186
_request_auth=_request_auth,
@@ -1198,6 +1214,8 @@ def create_table_with_http_info(
11981214
@validate_call
11991215
def create_table_without_preload_content(
12001216
self,
1217+
prefix: Annotated[StrictStr, Field(description="An optional prefix in the path")],
1218+
namespace: Annotated[StrictStr, Field(description="A namespace identifier as a single string. Multipart namespace parts should be separated by the unit separator (`0x1F`) byte.")],
12011219
create_table_request: CreateTableRequest,
12021220
x_iceberg_access_delegation: Annotated[Optional[StrictStr], Field(description="Optional signal to the server that the client supports delegated access via a comma-separated list of access mechanisms. The server may choose to supply access via any or none of the requested mechanisms. Specific properties and handling for `vended-credentials` is documented in the `LoadTableResult` schema section of this spec document. The protocol and specification for `remote-signing` is documented in the `s3-signer-open-api.yaml` OpenApi spec in the `aws` module. ")] = None,
12031221
_request_timeout: Union[
@@ -1217,6 +1235,10 @@ def create_table_without_preload_content(
12171235
12181236
Create a table or start a create transaction, like atomic CTAS. If `stage-create` is false, the table is created immediately. If `stage-create` is true, the table is not created, but table metadata is initialized and returned. The service should prepare as needed for a commit to the table commit endpoint to complete the create transaction. The client uses the returned metadata to begin a transaction. To commit the transaction, the client sends all create and subsequent changes to the table commit route. Changes from the table create operation include changes like AddSchemaUpdate and SetCurrentSchemaUpdate that set the initial table state.
12191237
1238+
:param prefix: An optional prefix in the path (required)
1239+
:type prefix: str
1240+
:param namespace: A namespace identifier as a single string. Multipart namespace parts should be separated by the unit separator (`0x1F`) byte. (required)
1241+
:type namespace: str
12201242
:param create_table_request: (required)
12211243
:type create_table_request: CreateTableRequest
12221244
:param x_iceberg_access_delegation: Optional signal to the server that the client supports delegated access via a comma-separated list of access mechanisms. The server may choose to supply access via any or none of the requested mechanisms. Specific properties and handling for `vended-credentials` is documented in the `LoadTableResult` schema section of this spec document. The protocol and specification for `remote-signing` is documented in the `s3-signer-open-api.yaml` OpenApi spec in the `aws` module.
@@ -1244,6 +1266,8 @@ def create_table_without_preload_content(
12441266
""" # noqa: E501
12451267

12461268
_param = self._create_table_serialize(
1269+
prefix=prefix,
1270+
namespace=namespace,
12471271
create_table_request=create_table_request,
12481272
x_iceberg_access_delegation=x_iceberg_access_delegation,
12491273
_request_auth=_request_auth,
@@ -1272,6 +1296,8 @@ def create_table_without_preload_content(
12721296

12731297
def _create_table_serialize(
12741298
self,
1299+
prefix,
1300+
namespace,
12751301
create_table_request,
12761302
x_iceberg_access_delegation,
12771303
_request_auth,
@@ -1293,6 +1319,10 @@ def _create_table_serialize(
12931319
_body_params: Optional[bytes] = None
12941320

12951321
# process the path parameters
1322+
if prefix is not None:
1323+
_path_params['prefix'] = prefix
1324+
if namespace is not None:
1325+
_path_params['namespace'] = namespace
12961326
# process the query parameters
12971327
# process the header parameters
12981328
if x_iceberg_access_delegation is not None:

spec/generated/bundled-polaris-catalog-service.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,8 @@ paths:
440440
If `stage-create` is true, the table is not created, but table metadata is initialized and returned. The service should prepare as needed for a commit to the table commit endpoint to complete the create transaction. The client uses the returned metadata to begin a transaction. To commit the transaction, the client sends all create and subsequent changes to the table commit route. Changes from the table create operation include changes like AddSchemaUpdate and SetCurrentSchemaUpdate that set the initial table state.
441441
operationId: createTable
442442
parameters:
443+
- $ref: '#/components/parameters/prefix'
444+
- $ref: '#/components/parameters/namespace'
443445
- $ref: '#/components/parameters/data-access'
444446
requestBody:
445447
required: true

spec/iceberg-rest-catalog-open-api.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,8 @@ paths:
559559
table state.
560560
operationId: createTable
561561
parameters:
562+
- $ref: '#/components/parameters/prefix'
563+
- $ref: '#/components/parameters/namespace'
562564
- $ref: '#/components/parameters/data-access'
563565
requestBody:
564566
required: true

0 commit comments

Comments
 (0)