Skip to content

Commit 3e6c837

Browse files
author
SachinVarghese
committed
Updating the sdk patch for model metadata service
1 parent 80da8b3 commit 3e6c837

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,8 @@ These extra files and customisation can be found in the
6969
1. Update the [swagger file](./swagger-v1alpha1.yml) with latest specification.
7070
2. Update [config file](./config/python.json) to bump the package version.
7171
3. Run `make python` to re-generate the sdk api files from new specifications.
72+
73+
**Note** : For Seldon Deploy model metadata service, we are having to patch two additional dict type parameters namely `tags` and `metrics` to the generated docs and sdk code. We do this manually, using the same make command, by applying the [patch file](./templates/python/metadata_tags_metrics.patch) file to the code, post sdk generation task. In some cases the patch apply cmd may fail, and there might be a requirement to re-generate the patch manually by changing the generated docs/sdk files as required.
74+
7275
4. Run `make -C build push` to build & push latest release to [PyPi](https://pypi.org/project/seldon-deploy-sdk/)
7376
5. Create a new Github Tag and Release with latest version and notes.

templates/python/metadata_tags_metrics.patch

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/python/docs/ModelMetadataServiceApi.md b/python/docs/ModelMetadataServiceApi.md
2-
index 4ca2775..481780a 100644
2+
index b257b08..3da9999 100644
33
--- a/python/docs/ModelMetadataServiceApi.md
44
+++ b/python/docs/ModelMetadataServiceApi.md
55
@@ -140,6 +140,8 @@ version = 'version_example' # str | (optional)
@@ -11,16 +11,16 @@ index 4ca2775..481780a 100644
1111
query = 'query_example' # str | For more complex queries where other logical operators like OR, NOT, etc. (optional)
1212
page_size = 56 # int | Optional. The maximum number of Folders to return in the response. (optional)
1313
page_token = 'page_token_example' # str | Optional. A pagination token returned from a previous call to `List` that indicates where this listing should continue from. (optional)
14-
@@ -149,7 +151,7 @@ order_by = 'order_by_example' # str | The order in which to return the model met
14+
@@ -150,7 +152,7 @@ default_protocol = 'PROTOCOL_UNKNOWN' # str | (optional) (default to PROTOCOL_U
1515

1616
try:
1717
# List Model Metadata entries.
18-
- api_response = api_instance.model_metadata_service_list_model_metadata(uri=uri, name=name, version=version, artifact_type=artifact_type, task_type=task_type, model_type=model_type, query=query, page_size=page_size, page_token=page_token, list_mask=list_mask, project=project, order_by=order_by)
19-
+ api_response = api_instance.model_metadata_service_list_model_metadata(uri=uri, name=name, version=version, artifact_type=artifact_type, task_type=task_type, model_type=model_type, tags=tags, metrics=metrics, query=query, page_size=page_size, page_token=page_token, list_mask=list_mask, project=project, order_by=order_by)
18+
- api_response = api_instance.model_metadata_service_list_model_metadata(uri=uri, name=name, version=version, artifact_type=artifact_type, task_type=task_type, model_type=model_type, query=query, page_size=page_size, page_token=page_token, list_mask=list_mask, project=project, order_by=order_by, default_protocol=default_protocol)
19+
+ api_response = api_instance.model_metadata_service_list_model_metadata(uri=uri, name=name, version=version, artifact_type=artifact_type, task_type=task_type, model_type=model_type, tags=tags, metrics=metrics, query=query, page_size=page_size, page_token=page_token, list_mask=list_mask, project=project, order_by=order_by, default_protocol=default_protocol)
2020
pprint(api_response)
2121
except ApiException as e:
2222
print("Exception when calling ModelMetadataServiceApi->model_metadata_service_list_model_metadata: %s\n" % e)
23-
@@ -165,6 +167,8 @@ Name | Type | Description | Notes
23+
@@ -166,6 +168,8 @@ Name | Type | Description | Notes
2424
**artifact_type** | **str**| | [optional] [default to UNKNOWN]
2525
**task_type** | **str**| | [optional]
2626
**model_type** | **str**| | [optional]
@@ -30,7 +30,7 @@ index 4ca2775..481780a 100644
3030
**page_size** | **int**| Optional. The maximum number of Folders to return in the response. | [optional]
3131
**page_token** | **str**| Optional. A pagination token returned from a previous call to `List` that indicates where this listing should continue from. | [optional]
3232
diff --git a/python/seldon_deploy_sdk/api/model_metadata_service_api.py b/python/seldon_deploy_sdk/api/model_metadata_service_api.py
33-
index 8b5d077..b667f5c 100644
33+
index 312e067..47adb43 100644
3434
--- a/python/seldon_deploy_sdk/api/model_metadata_service_api.py
3535
+++ b/python/seldon_deploy_sdk/api/model_metadata_service_api.py
3636
@@ -247,6 +247,8 @@ class ModelMetadataServiceApi(object):
@@ -42,7 +42,7 @@ index 8b5d077..b667f5c 100644
4242
:param str query: For more complex queries where other logical operators like OR, NOT, etc.
4343
:param int page_size: Optional. The maximum number of Folders to return in the response.
4444
:param str page_token: Optional. A pagination token returned from a previous call to `List` that indicates where this listing should continue from.
45-
@@ -280,6 +282,8 @@ class ModelMetadataServiceApi(object):
45+
@@ -281,6 +283,8 @@ class ModelMetadataServiceApi(object):
4646
:param str artifact_type:
4747
:param str task_type:
4848
:param str model_type:
@@ -51,16 +51,16 @@ index 8b5d077..b667f5c 100644
5151
:param str query: For more complex queries where other logical operators like OR, NOT, etc.
5252
:param int page_size: Optional. The maximum number of Folders to return in the response.
5353
:param str page_token: Optional. A pagination token returned from a previous call to `List` that indicates where this listing should continue from.
54-
@@ -291,7 +295,7 @@ class ModelMetadataServiceApi(object):
54+
@@ -293,7 +297,7 @@ class ModelMetadataServiceApi(object):
5555
returns the request thread.
5656
"""
5757

58-
- all_params = ['uri', 'name', 'version', 'artifact_type', 'task_type', 'model_type', 'query', 'page_size', 'page_token', 'list_mask', 'project', 'order_by'] # noqa: E501
59-
+ all_params = ['uri', 'name', 'version', 'artifact_type', 'task_type', 'model_type', 'tags', 'metrics', 'query', 'page_size', 'page_token', 'list_mask', 'project', 'order_by'] # noqa: E501
58+
- all_params = ['uri', 'name', 'version', 'artifact_type', 'task_type', 'model_type', 'query', 'page_size', 'page_token', 'list_mask', 'project', 'order_by', 'default_protocol'] # noqa: E501
59+
+ all_params = ['uri', 'name', 'version', 'artifact_type', 'task_type', 'model_type', 'tags', 'metrics', 'query', 'page_size', 'page_token', 'list_mask', 'project', 'order_by', 'default_protocol'] # noqa: E501
6060
all_params.append('async_req')
6161
all_params.append('_return_http_data_only')
6262
all_params.append('_preload_content')
63-
@@ -324,6 +328,12 @@ class ModelMetadataServiceApi(object):
63+
@@ -326,6 +330,12 @@ class ModelMetadataServiceApi(object):
6464
query_params.append(('taskType', params['task_type'])) # noqa: E501
6565
if 'model_type' in params:
6666
query_params.append(('modelType', params['model_type'])) # noqa: E501

0 commit comments

Comments
 (0)