Skip to content

Commit 2863dc0

Browse files
authored
feat: LRO metadata (#204)
* chore: release 0.5.0 Release-As: 0.5.0 * feat: update export model examples to print operation.metadata.output_info
1 parent f5839f8 commit 2863dc0

6 files changed

+20
-7
lines changed

.sample_configs/process_configs.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,21 @@ export_data_sample:
148148
resource_name: dataset
149149
export_evaluated_data_items_sample:
150150
resource_name: model_evaluation
151-
export_model_sample: {}
152-
export_model_tabular_classification_sample: {}
153-
export_model_video_action_recognition_sample: {}
154-
export_model_video_classification_sample: {}
155-
export_model_video_object_tracking_sample: {}
151+
export_model_sample:
152+
lro_metadata:
153+
- output_info
154+
export_model_tabular_classification_sample:
155+
lro_metadata:
156+
- output_info
157+
export_model_video_action_recognition_sample:
158+
lro_metadata:
159+
- output_info
160+
export_model_video_classification_sample:
161+
lro_metadata:
162+
- output_info
163+
export_model_video_object_tracking_sample:
164+
lro_metadata:
165+
- output_info
156166
get_annotation_spec_sample: {}
157167
get_batch_prediction_job_sample:
158168
skip:

samples/snippets/export_model_sample.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def export_model_sample(
3535
name = client.model_path(project=project, location=location, model=model_id)
3636
response = client.export_model(name=name, output_config=output_config)
3737
print("Long running operation:", response.operation.name)
38+
print("output_info:", response.metadata.output_info)
3839
export_model_response = response.result(timeout=timeout)
3940
print("export_model_response:", export_model_response)
4041

samples/snippets/export_model_tabular_classification_sample.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def export_model_tabular_classification_sample(
3737
name = client.model_path(project=project, location=location, model=model_id)
3838
response = client.export_model(name=name, output_config=output_config)
3939
print("Long running operation:", response.operation.name)
40+
print("output_info:", response.metadata.output_info)
4041
export_model_response = response.result(timeout=timeout)
4142
print("export_model_response:", export_model_response)
4243

samples/snippets/export_model_tabular_classification_sample_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ def test_ucaip_generated_export_model_tabular_classification_sample(capsys):
4242
gcs_destination_output_uri_prefix=f"{GCS_BUCKET}/{GCS_PREFIX}",
4343
)
4444
out, _ = capsys.readouterr()
45-
assert "export_model_response" in out
45+
assert "output_info" in out

samples/snippets/export_model_video_action_recognition_sample.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def export_model_video_action_recognition_sample(
3838
name = client.model_path(project=project, location=location, model=model_id)
3939
response = client.export_model(name=name, output_config=output_config)
4040
print("Long running operation:", response.operation.name)
41+
print("output_info:", response.metadata.output_info)
4142
export_model_response = response.result(timeout=timeout)
4243
print("export_model_response:", export_model_response)
4344

samples/snippets/export_model_video_action_recognition_sample_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ def test_export_model_video_action_recognition_sample(capsys):
4646
export_format=EXPORT_FORMAT,
4747
)
4848
out, _ = capsys.readouterr()
49-
assert "export_model_response" in out
49+
assert "output_info" in out

0 commit comments

Comments
 (0)