Skip to content

Commit 4b09365

Browse files
committed
delete test case using real model
1 parent 5765025 commit 4b09365

File tree

1 file changed

+0
-63
lines changed

1 file changed

+0
-63
lines changed

metadata-ingestion/tests/unit/test_vertexai_source.py

-63
Original file line numberDiff line numberDiff line change
@@ -126,35 +126,6 @@ def source() -> VertexAISource:
126126
config=VertexAIConfig(project_id=PROJECT_ID, region=REGION),
127127
)
128128

129-
130-
def gen_real_model(source: VertexAISource) -> Model:
131-
"""
132-
Fixture for the model that is actually registered in the Vertex AI Model Registry
133-
Use mock_model for local testing purpose, but this fixture is provided to use real model for debugging.
134-
Replace model name with your real model when using this fixture.
135-
"""
136-
model_name = "projects/872197881936/locations/us-west2/models/3583871344875405312"
137-
return Model(model_name=model_name)
138-
139-
140-
def gen_real_autoML_tabular_job(source: VertexAISource) -> _TrainingJob:
141-
"""
142-
Fixture for the training job that is actually registered in the Vertex AI Model Registry
143-
Use mock_training_job for local testing purpose, but this fixture is provided to use real training job for debugging.
144-
Replace training job name with your real training job when using this fixture.
145-
"""
146-
147-
# Initialize the AI Platform client
148-
aiplatform.init(project=source.config.project_id, location=source.config.region)
149-
150-
# Retrieve the custom training job by its resource name
151-
# resource_name format 'projects/your-project-id/locations/your-location/trainingPipelines/your-training-job-id')
152-
job = aiplatform.AutoMLTabularTrainingJob.get(
153-
resource_name="projects/872197881936/locations/us-west2/trainingPipelines/5401695018589093888"
154-
)
155-
return job
156-
157-
158129
@patch("google.cloud.aiplatform.Model.list")
159130
def test_get_ml_model_workunits(mock_list: List[Model], source: VertexAISource) -> None:
160131
mock_models = gen_mock_models()
@@ -419,37 +390,3 @@ def test_make_job_urn(source: VertexAISource) -> None:
419390
source._make_job_urn(mock_training_job)
420391
== f"{builder.make_data_process_instance_urn(source._make_vertexai_job_name(mock_training_job.name))}"
421392
)
422-
423-
424-
@pytest.mark.skip(reason="Skipping, this is for debugging purpose")
425-
def test_real_model_workunit(source: VertexAISource) -> None:
426-
"""
427-
Disabled as default
428-
Use real model registered in the Vertex AI Model Registry
429-
"""
430-
real_model = gen_real_model(source)
431-
model_version = gen_mock_model_version(real_model)
432-
for wu in source._gen_ml_model_workunits(
433-
model=real_model, model_version=model_version
434-
):
435-
assert hasattr(wu.metadata, "aspect")
436-
aspect = wu.metadata.aspect
437-
assert isinstance(aspect, MLModelProperties)
438-
# aspect is MLModelPropertiesClass
439-
assert aspect.description == model_version.version_description
440-
assert aspect.date == model_version.version_create_time
441-
assert aspect.hyperParams is None
442-
assert aspect.trainingMetrics is None
443-
444-
445-
@pytest.mark.skip(reason="Skipping, this is for debugging purpose")
446-
def test_real_get_data_process_properties(source: VertexAISource) -> None:
447-
real_autoML_tabular_job = gen_real_autoML_tabular_job(source)
448-
for wu in source._get_training_job_workunits(real_autoML_tabular_job):
449-
assert hasattr(wu.metadata, "aspect")
450-
aspect = wu.metadata.aspect
451-
if isinstance(aspect, DataProcessInstancePropertiesClass):
452-
# aspect is DataProcessInstancePropertiesClass
453-
assert aspect.externalUrl == source._make_job_external_url(
454-
real_autoML_tabular_job
455-
)

0 commit comments

Comments
 (0)