From b898a98b808b3e6bdb5a7de405741b48bbf5dbf7 Mon Sep 17 00:00:00 2001 From: Harshal Sheth Date: Tue, 16 Jul 2024 16:40:22 -0700 Subject: [PATCH 1/2] fix(ingest): fix docs build Was broken by 1565fb01028efaaff5bfdef7e429f63eb0502b2d --- metadata-ingestion/scripts/modeldocgen.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/metadata-ingestion/scripts/modeldocgen.py b/metadata-ingestion/scripts/modeldocgen.py index ea7813f0ca85b..e58a189eaa617 100644 --- a/metadata-ingestion/scripts/modeldocgen.py +++ b/metadata-ingestion/scripts/modeldocgen.py @@ -8,12 +8,12 @@ from dataclasses import Field, dataclass, field from enum import auto from pathlib import Path -from typing import Any, Dict, List, Optional, Tuple, Iterable +from typing import Any, Dict, Iterable, List, Optional, Tuple import avro.schema import click -from datahub.configuration.common import ConfigEnum, ConfigModel +from datahub.configuration.common import ConfigEnum, PermissiveConfigModel from datahub.emitter.mce_builder import make_data_platform_urn, make_dataset_urn from datahub.emitter.mcp import MetadataChangeProposalWrapper from datahub.emitter.rest_emitter import DatahubRestEmitter @@ -22,7 +22,9 @@ from datahub.ingestion.extractor.schema_util import avro_schema_to_mce_fields from datahub.ingestion.sink.file import FileSink, FileSinkConfig from datahub.metadata.schema_classes import ( + BrowsePathEntryClass, BrowsePathsClass, + BrowsePathsV2Class, DatasetPropertiesClass, DatasetSnapshotClass, ForeignKeyConstraintClass, @@ -34,8 +36,6 @@ StringTypeClass, SubTypesClass, TagAssociationClass, - BrowsePathsV2Class, - BrowsePathEntryClass, ) logger = logging.getLogger(__name__) @@ -493,14 +493,14 @@ def strip_types(field_path: str) -> str: ], ) + @dataclass class EntityAspectName: entityName: str aspectName: str -@dataclass -class AspectPluginConfig: +class AspectPluginConfig(PermissiveConfigModel): className: str enabled: bool supportedEntityAspectNames: List[EntityAspectName] @@ -508,15 +508,14 @@ class AspectPluginConfig: supportedOperations: Optional[List[str]] = None -@dataclass -class PluginConfiguration: +class PluginConfiguration(PermissiveConfigModel): aspectPayloadValidators: Optional[List[AspectPluginConfig]] = None mutationHooks: Optional[List[AspectPluginConfig]] = None mclSideEffects: Optional[List[AspectPluginConfig]] = None mcpSideEffects: Optional[List[AspectPluginConfig]] = None -class EntityRegistry(ConfigModel): +class EntityRegistry(PermissiveConfigModel): entities: List[EntityDefinition] events: Optional[List[EventDefinition]] plugins: Optional[PluginConfiguration] = None From 6bfd52f4848fc30baabe7afcae6cd632775bb49f Mon Sep 17 00:00:00 2001 From: Harshal Sheth Date: Wed, 17 Jul 2024 08:37:07 -0700 Subject: [PATCH 2/2] fix build --- metadata-ingestion/scripts/modeldocgen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata-ingestion/scripts/modeldocgen.py b/metadata-ingestion/scripts/modeldocgen.py index e58a189eaa617..ee5f06cb801ba 100644 --- a/metadata-ingestion/scripts/modeldocgen.py +++ b/metadata-ingestion/scripts/modeldocgen.py @@ -503,7 +503,7 @@ class EntityAspectName: class AspectPluginConfig(PermissiveConfigModel): className: str enabled: bool - supportedEntityAspectNames: List[EntityAspectName] + supportedEntityAspectNames: List[EntityAspectName] = [] packageScan: Optional[List[str]] = None supportedOperations: Optional[List[str]] = None