Skip to content

Commit ba6585b

Browse files
committed
Fixed review comment
1 parent dedab91 commit ba6585b

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

metadata-ingestion/src/datahub/ingestion/source/vertexai.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def _gen_training_job_mcps(
273273
if job.create_time
274274
else datetime_to_ts_millis(datetime.now())
275275
)
276-
created_actor = f"urn:li:platformResource:{self.platform}"
276+
created_actor = "urn:li:corpuser:datahub"
277277

278278
aspects: List[_Aspect] = list()
279279
aspects.append(
@@ -402,7 +402,7 @@ def _search_dataset(self, dataset_id: str) -> Optional[VertexAiResourceNoun]:
402402
for ds in dataset_class.list():
403403
self.datasets[ds.name] = ds
404404

405-
return self.datasets[dataset_id] if dataset_id in self.datasets else None
405+
return self.datasets.get(dataset_id)
406406

407407
def _get_input_dataset_mcps(
408408
self, job_meta: TrainingJobMetadata

metadata-ingestion/tests/integration/vertexai/test_vertexai.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from typing import Any, Dict, TypeVar
44
from unittest.mock import patch
55

6-
import pytest
76
from pytest import Config
87

98
from datahub.ingestion.run.pipeline import Pipeline
@@ -22,11 +21,6 @@
2221
REGION = "us-west2"
2322

2423

25-
@pytest.fixture
26-
def sink_file_path(tmp_path: Path) -> str:
27-
return str(tmp_path / "vertexai_source_mcps.json")
28-
29-
3024
def get_pipeline_config(sink_file_path: str) -> Dict[str, Any]:
3125
source_type = "vertexai"
3226
return {
@@ -47,7 +41,7 @@ def get_pipeline_config(sink_file_path: str) -> Dict[str, Any]:
4741
}
4842

4943

50-
def test_vertexai_source_ingestion(pytestconfig: Config, sink_file_path: str) -> None:
44+
def test_vertexai_source_ingestion(pytestconfig: Config, tmp_path: Path) -> None:
5145
with contextlib.ExitStack() as exit_stack:
5246
# Mock the Vertex API with empty list
5347
for func_to_mock in [
@@ -99,6 +93,7 @@ def test_vertexai_source_ingestion(pytestconfig: Config, sink_file_path: str) ->
9993
/ "tests/integration/vertexai/vertexai_mcps_golden.json"
10094
)
10195

96+
sink_file_path = str(tmp_path / "vertexai_source_mcps.json")
10297
print(f"Output mcps file path: {str(sink_file_path)}")
10398
print(f"Golden file path: {str(golden_file_path)}")
10499

0 commit comments

Comments
 (0)