|
1 | 1 | import logging |
2 | | -from typing import Dict, Iterable, List, Optional, Tuple |
| 2 | +from typing import Dict, Iterable, List, Optional, Tuple, Union |
3 | 3 |
|
4 | 4 | from pydantic import Field |
5 | 5 |
|
|
14 | 14 | support_status, |
15 | 15 | ) |
16 | 16 | from datahub.ingestion.api.source import Source, SourceReport, StructuredLogCategory |
| 17 | +from datahub.ingestion.api.source_helpers import AutoSystemMetadata, auto_workunit |
17 | 18 | from datahub.ingestion.api.workunit import MetadataWorkUnit |
18 | 19 | from datahub.ingestion.source.common.subtypes import DatasetSubTypes |
19 | 20 | from datahub.ingestion.source.mock_data.datahub_mock_data_report import ( |
|
31 | 32 | UpstreamClass, |
32 | 33 | UpstreamLineageClass, |
33 | 34 | ) |
| 35 | +from datahub.sdk.entity import Entity |
34 | 36 | from datahub.utilities.str_enum import StrEnum |
35 | 37 |
|
36 | 38 | logger = logging.getLogger(__name__) |
@@ -165,6 +167,14 @@ def __init__(self, ctx: PipelineContext, config: DataHubMockDataConfig): |
165 | 167 | self.report = DataHubMockDataReport() |
166 | 168 |
|
167 | 169 | def get_workunits(self) -> Iterable[MetadataWorkUnit]: |
| 170 | + workunit_processors = [AutoSystemMetadata(self.ctx).stamp] |
| 171 | + return self._apply_workunit_processors( |
| 172 | + workunit_processors, auto_workunit(self.get_workunits_internal()) |
| 173 | + ) |
| 174 | + |
| 175 | + def get_workunits_internal( |
| 176 | + self, |
| 177 | + ) -> Iterable[Union[MetadataWorkUnit, MetadataChangeProposalWrapper, Entity]]: |
168 | 178 | # We don't want any implicit aspects to be produced |
169 | 179 | # so we are not using get_workunits_internal |
170 | 180 |
|
|
0 commit comments