From aa7303b0849042e990c779f2f5b4a9183396f882 Mon Sep 17 00:00:00 2001 From: avi <252974426+aviraj-gour@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:30:50 +0530 Subject: [PATCH 01/20] refactor(ingest): describe MCP output in comments and check metadata-file Connectors now emit MCPs, so comments that said MCE were stale. `datahub check metadata-file` counts every record the file source produced, MCE or MCP, so it now reports "records found". --- .../docs/sources/metadata-file/file_recipe.yml | 2 +- metadata-ingestion/src/datahub/cli/json_file.py | 2 +- metadata-ingestion/src/datahub/emitter/mce_builder.py | 2 +- .../src/datahub/executor/execution/reporting_executor.py | 3 +-- .../datahub/ingestion/api/incremental_ownership_helper.py | 7 +++---- .../datahub/ingestion/source/dataplex/dataplex_glossary.py | 2 +- .../ingestion/source/fivetran/fivetran_log_rest_reader.py | 2 +- .../src/datahub/ingestion/source/grafana/grafana_source.py | 1 - .../src/datahub/ingestion/source/sqlmesh/sqlmesh_source.py | 2 +- 9 files changed, 10 insertions(+), 13 deletions(-) diff --git a/metadata-ingestion/docs/sources/metadata-file/file_recipe.yml b/metadata-ingestion/docs/sources/metadata-file/file_recipe.yml index 7cc405959059..754850cff49a 100644 --- a/metadata-ingestion/docs/sources/metadata-file/file_recipe.yml +++ b/metadata-ingestion/docs/sources/metadata-file/file_recipe.yml @@ -2,7 +2,7 @@ source: type: file config: # Coordinates - path: ./path/to/mce/file.json + path: ./path/to/metadata/file.json sink: # sink configs diff --git a/metadata-ingestion/src/datahub/cli/json_file.py b/metadata-ingestion/src/datahub/cli/json_file.py index c2c17d92e511..c55b5f64ef3c 100644 --- a/metadata-ingestion/src/datahub/cli/json_file.py +++ b/metadata-ingestion/src/datahub/cli/json_file.py @@ -23,4 +23,4 @@ def check_mce_file(filepath: str) -> str: f"Failed to process file due to {mce_source.get_report().failures}" ) else: - return f"{mce_source.get_report().events_produced} MCEs found - all valid" + return f"{mce_source.get_report().events_produced} records found - all valid" diff --git a/metadata-ingestion/src/datahub/emitter/mce_builder.py b/metadata-ingestion/src/datahub/emitter/mce_builder.py index 80fdbe5f3515..8c3b5164e905 100644 --- a/metadata-ingestion/src/datahub/emitter/mce_builder.py +++ b/metadata-ingestion/src/datahub/emitter/mce_builder.py @@ -1,4 +1,4 @@ -"""Convenience functions for creating MCEs""" +"""Convenience functions for building URNs and aspects, plus legacy MCE helpers""" import hashlib import json diff --git a/metadata-ingestion/src/datahub/executor/execution/reporting_executor.py b/metadata-ingestion/src/datahub/executor/execution/reporting_executor.py index 2ae1dfd1d236..6cbef2c09d6a 100644 --- a/metadata-ingestion/src/datahub/executor/execution/reporting_executor.py +++ b/metadata-ingestion/src/datahub/executor/execution/reporting_executor.py @@ -138,8 +138,7 @@ def signal(self, request: SignalRequest) -> None: should_emit_cancellation = True if should_emit_cancellation: - # No task found. Simply emit a cancelled MCE. The start time is unclear. - # Build & emit the cancellation mcp + # No task found. Simply emit a cancelled MCP. The start time is unclear. cancellation_mcp = self._build_empty_cancel_mcp(exec_id=exec_id) self._datahub_graph.emit_mcp(cancellation_mcp, async_flag=False) diff --git a/metadata-ingestion/src/datahub/ingestion/api/incremental_ownership_helper.py b/metadata-ingestion/src/datahub/ingestion/api/incremental_ownership_helper.py index e57ea047b04b..bb557937d77b 100644 --- a/metadata-ingestion/src/datahub/ingestion/api/incremental_ownership_helper.py +++ b/metadata-ingestion/src/datahub/ingestion/api/incremental_ownership_helper.py @@ -6,10 +6,9 @@ types (datasets, containers, charts, dashboards, glossary terms, ML models, …). The patch path uses ``create_dataset_owners_patch_builder`` → ``DatasetPatchBuilder``, which is dataset-specific. We therefore filter - explicitly by dataset URN (MCE) / ``entityType == "dataset"`` (MCPW); - non-dataset ownership passes through as UPSERT. Compare - ``auto_incremental_lineage``, which dispatches across - dataset/chart/dashboard patch builders for the same reason. + explicitly by ``entityType == "dataset"``; non-dataset ownership passes + through as UPSERT. Compare ``auto_incremental_lineage``, which dispatches + across dataset/chart/dashboard patch builders for the same reason. 2. Empty owners are dropped silently. ``create_dataset_owners_patch_builder`` emits one patch op per owner, so an empty ``owners`` list yields zero ops diff --git a/metadata-ingestion/src/datahub/ingestion/source/dataplex/dataplex_glossary.py b/metadata-ingestion/src/datahub/ingestion/source/dataplex/dataplex_glossary.py index 109026af9a1c..ea78ab0d58b4 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/dataplex/dataplex_glossary.py +++ b/metadata-ingestion/src/datahub/ingestion/source/dataplex/dataplex_glossary.py @@ -573,7 +573,7 @@ def process_term_associations(self, max_workers: int) -> Iterable[MetadataWorkUn the complete list of all its linked terms. Without phase separation, emitting one MCP per (asset, term) pair would - cause each MCE to overwrite the previous one, leaving an asset with only + cause each MCP to overwrite the previous one, leaving an asset with only its last-processed term. """ entry_name_to_urn = self._ctx.entry_name_to_urn diff --git a/metadata-ingestion/src/datahub/ingestion/source/fivetran/fivetran_log_rest_reader.py b/metadata-ingestion/src/datahub/ingestion/source/fivetran/fivetran_log_rest_reader.py index 15f4edc155fd..7de786aab84b 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/fivetran/fivetran_log_rest_reader.py +++ b/metadata-ingestion/src/datahub/ingestion/source/fivetran/fivetran_log_rest_reader.py @@ -208,7 +208,7 @@ def get_user_email(self, user_id: Optional[str]) -> Optional[str]: except _RECOVERABLE_REST_ERRORS as e: # A single bad group shouldn't crash the run — owner emails # for that group's connectors will be missing in the emitted - # MCEs, but lineage is unaffected. + # MCPs, but lineage is unaffected. self._report.warning( title="Failed to list Fivetran group users", message="Owner email lookups for connectors in this group will return None.", diff --git a/metadata-ingestion/src/datahub/ingestion/source/grafana/grafana_source.py b/metadata-ingestion/src/datahub/ingestion/source/grafana/grafana_source.py index 765c67dbe8a7..15dd9900b1a7 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/grafana/grafana_source.py +++ b/metadata-ingestion/src/datahub/ingestion/source/grafana/grafana_source.py @@ -337,7 +337,6 @@ def _process_dashboard(self, dashboard: Dashboard) -> Iterable[MetadataWorkUnit] for panel in dashboard.panels: self.report.report_chart_scanned() - # Create chart MCE dataset_urn, chart_urn, chart_mcps = build_chart_mcps( panel=panel, dashboard=dashboard, diff --git a/metadata-ingestion/src/datahub/ingestion/source/sqlmesh/sqlmesh_source.py b/metadata-ingestion/src/datahub/ingestion/source/sqlmesh/sqlmesh_source.py index 8fcbf624c67d..f5c097324dc5 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sqlmesh/sqlmesh_source.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sqlmesh/sqlmesh_source.py @@ -578,7 +578,7 @@ def _emit_model( # Emit status FIRST so the MAE consumer can always hydrate the entity, # even if it processes this MCL before other aspects are committed. - # dbt uses the same pattern (StatusClass appended before MCE bundling). + # dbt uses the same pattern (StatusClass emitted before the other aspects). yield MetadataChangeProposalWrapper( entityUrn=sqlmesh_urn, aspect=StatusClass(removed=False), From 81c9d8129e9e13b2220cfcc2e348525cc908f753 Mon Sep 17 00:00:00 2001 From: avi <252974426+aviraj-gour@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:33:14 +0530 Subject: [PATCH 02/20] refactor(ingest/sql): drop SqlWorkUnit from return type hints SQL sources no longer construct SqlWorkUnit, so their work unit iterables are plain MetadataWorkUnit. The class itself stays for custom sources that import or subclass it. --- .../datahub/ingestion/source/redshift/redshift.py | 5 ++--- .../ingestion/source/sql/doris/doris_source.py | 11 +++++------ .../src/datahub/ingestion/source/sql/hana/hana.py | 6 +++--- .../ingestion/source/sql/hive/hive_source.py | 8 ++++---- .../src/datahub/ingestion/source/sql/oracle.py | 7 +++---- .../ingestion/source/sql/postgres/source.py | 4 +--- .../datahub/ingestion/source/sql/sql_common.py | 12 ++++++------ .../src/datahub/ingestion/source/sql/teradata.py | 6 +++--- .../datahub/ingestion/source/sql/timescaledb.py | 9 ++++----- .../src/datahub/ingestion/source/sql/trino.py | 7 +++---- .../src/datahub/ingestion/source/sql/vertica.py | 15 +++++++-------- .../unit/test_hive_source_storage_lineage.py | 6 +++--- 12 files changed, 44 insertions(+), 52 deletions(-) diff --git a/metadata-ingestion/src/datahub/ingestion/source/redshift/redshift.py b/metadata-ingestion/src/datahub/ingestion/source/redshift/redshift.py index 261acde273f0..3b9121991ac1 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/redshift/redshift.py +++ b/metadata-ingestion/src/datahub/ingestion/source/redshift/redshift.py @@ -64,7 +64,6 @@ ) from datahub.ingestion.source.redshift.report import RedshiftReport from datahub.ingestion.source.redshift.usage import RedshiftUsageExtractor -from datahub.ingestion.source.sql.sql_common import SqlWorkUnit from datahub.ingestion.source.sql.sql_types import resolve_postgres_modified_type from datahub.ingestion.source.sql.sql_utils import ( add_table_to_schema_container, @@ -418,7 +417,7 @@ def _warn_deprecated_configs(self): log=False, ) - def get_workunits_internal(self) -> Iterable[Union[MetadataWorkUnit, SqlWorkUnit]]: + def get_workunits_internal(self) -> Iterable[MetadataWorkUnit]: self._warn_deprecated_configs() connection = self._try_get_redshift_connection(self.config) @@ -444,7 +443,7 @@ def get_workunits_internal(self) -> Iterable[Union[MetadataWorkUnit, SqlWorkUnit def _extract_metadata( self, connection: redshift_connector.Connection, database: str - ) -> Iterable[Union[MetadataWorkUnit, SqlWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: yield from self.gen_database_container( database=database, ) diff --git a/metadata-ingestion/src/datahub/ingestion/source/sql/doris/doris_source.py b/metadata-ingestion/src/datahub/ingestion/source/sql/doris/doris_source.py index 0b5111fa8a63..4bd6ea78b497 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sql/doris/doris_source.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sql/doris/doris_source.py @@ -11,7 +11,6 @@ Optional, Sequence, Set, - Union, ) from pydantic import Field, field_validator, model_validator @@ -54,7 +53,7 @@ MySQLProfilingConfig, MySQLSource, ) -from datahub.ingestion.source.sql.sql_common import SqlWorkUnit, register_custom_type +from datahub.ingestion.source.sql.sql_common import register_custom_type from datahub.ingestion.source.sql.sql_config import SQLCommonConfig from datahub.ingestion.source.sql.sql_report import SQLSourceReport from datahub.ingestion.source.sql.stored_procedures.models import BaseProcedure @@ -504,7 +503,7 @@ def _process_table( table: str, sql_config: SQLCommonConfig, data_reader: Optional[DataReader], - ) -> Iterable[Union[SqlWorkUnit, MetadataWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: return self._skip_lost_connection_tables( dataset_name, inspector, @@ -520,7 +519,7 @@ def _process_view( schema: str, view: str, sql_config: SQLCommonConfig, - ) -> Iterable[Union[SqlWorkUnit, MetadataWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: return self._skip_lost_connection_tables( dataset_name, inspector, @@ -531,8 +530,8 @@ def _skip_lost_connection_tables( self, dataset_name: str, inspector: Inspector, - workunits: Iterable[Union[SqlWorkUnit, MetadataWorkUnit]], - ) -> Iterable[Union[SqlWorkUnit, MetadataWorkUnit]]: + workunits: Iterable[MetadataWorkUnit], + ) -> Iterable[MetadataWorkUnit]: # `workunits` is the base class's generator, so nothing has been read yet. if self._skip_unreachable(inspector): return diff --git a/metadata-ingestion/src/datahub/ingestion/source/sql/hana/hana.py b/metadata-ingestion/src/datahub/ingestion/source/sql/hana/hana.py index 4ffd960aa084..fb37a1b7003b 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sql/hana/hana.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sql/hana/hana.py @@ -1,5 +1,5 @@ import logging -from typing import Iterable, Iterator, List, Optional, Union +from typing import Iterable, Iterator, List, Optional from sqlalchemy import create_engine from sqlalchemy.engine import Engine, Inspector @@ -20,7 +20,7 @@ HanaCalculationViewExtractor, ) from datahub.ingestion.source.sql.hana.hana_utils import HanaIdentifierBuilder -from datahub.ingestion.source.sql.sql_common import SQLAlchemySource, SqlWorkUnit +from datahub.ingestion.source.sql.sql_common import SQLAlchemySource from datahub.ingestion.source.sql.stored_procedures.models import BaseProcedure from datahub.ingestion.source_report.ingestion_stage import ( LINEAGE_EXTRACTION, @@ -212,7 +212,7 @@ def _populate_aggregator_from_queries(self) -> None: def get_workunits_internal( self, - ) -> Iterable[Union[MetadataWorkUnit, SqlWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: with self.report.new_stage(METADATA_EXTRACTION): yield from super().get_workunits_internal() diff --git a/metadata-ingestion/src/datahub/ingestion/source/sql/hive/hive_source.py b/metadata-ingestion/src/datahub/ingestion/source/sql/hive/hive_source.py index af4d3b0d1cd4..ce17e7a2148b 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sql/hive/hive_source.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sql/hive/hive_source.py @@ -2,7 +2,7 @@ import logging import re import urllib.parse -from typing import Any, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Union +from typing import Any, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple from pydantic import field_validator, model_validator from pydantic.fields import Field @@ -36,7 +36,7 @@ HiveStorageLineage, HiveStorageLineageConfigMixin, ) -from datahub.ingestion.source.sql.sql_common import SqlWorkUnit, register_custom_type +from datahub.ingestion.source.sql.sql_common import register_custom_type from datahub.ingestion.source.sql.sql_config import SQLCommonConfig from datahub.ingestion.source.sql.two_tier_sql_source import ( TwoTierSQLAlchemyConfig, @@ -155,7 +155,7 @@ def _process_table( table: str, sql_config: SQLCommonConfig, data_reader: Optional[DataReader], - ) -> Iterable[Union[SqlWorkUnit, MetadataWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: # Storage lineage needs DatasetProperties (Location) and SchemaMetadata (columns); # collect them by aspect type, since they may arrive in different work units. dataset_urn: Optional[str] = None @@ -271,7 +271,7 @@ def _process_view( schema: str, view: str, sql_config: SQLCommonConfig, - ) -> Iterable[Union[SqlWorkUnit, MetadataWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: dataset_urn = make_dataset_urn_with_platform_instance( self.platform, dataset_name, diff --git a/metadata-ingestion/src/datahub/ingestion/source/sql/oracle.py b/metadata-ingestion/src/datahub/ingestion/source/sql/oracle.py index a7267b12e669..2769d32397d4 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sql/oracle.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sql/oracle.py @@ -65,7 +65,6 @@ from datahub.ingestion.source.sql.sql_common import ( SQLAlchemySource, SQLCommonConfig, - SqlWorkUnit, get_schema_metadata, make_sqlalchemy_type, register_custom_type, @@ -1766,7 +1765,7 @@ def get_schema_level_workunits( inspector: Inspector, schema: str, database: str, - ) -> Iterable[Union[MetadataWorkUnit, SqlWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: yield from super().get_schema_level_workunits(inspector, schema, database) # Process materialized views if enabled @@ -2154,7 +2153,7 @@ def loop_materialized_views( inspector: Inspector, schema: str, sql_config: OracleConfig, - ) -> Iterable[Union[MetadataWorkUnit, SqlWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: """Loop through materialized views in the schema.""" # isinstance, not hasattr: SA 2.0's Inspector has its own # get_materialized_view_names, which doesn't exclude system schemas. @@ -2563,7 +2562,7 @@ def _generate_aggregator_workunits(self) -> Iterable[MetadataWorkUnit]: # Deferred: called explicitly after V$SQL population in get_workunits_internal. return iter([]) - def get_workunits_internal(self) -> Iterable[Union[MetadataWorkUnit, SqlWorkUnit]]: + def get_workunits_internal(self) -> Iterable[MetadataWorkUnit]: # Schema first: registers table/view schemas into the resolver so that # V$SQL queries and view definitions can resolve column-level lineage. with self.report.new_stage(METADATA_EXTRACTION): diff --git a/metadata-ingestion/src/datahub/ingestion/source/sql/postgres/source.py b/metadata-ingestion/src/datahub/ingestion/source/sql/postgres/source.py index c48c141696cf..1cfd79c5a6bb 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sql/postgres/source.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sql/postgres/source.py @@ -11,7 +11,6 @@ Optional, Tuple, Type, - Union, ) # This import verifies that the dependencies are available. @@ -68,7 +67,6 @@ from datahub.ingestion.source.sql.rds_iam import RDSIAMConnectionMixin from datahub.ingestion.source.sql.sql_common import ( SQLAlchemySource, - SqlWorkUnit, register_custom_type, ) from datahub.ingestion.source.sql.sql_config import ( @@ -800,7 +798,7 @@ def _list_table_partitions( ) return frozenset() - def get_workunits_internal(self) -> Iterable[Union[MetadataWorkUnit, SqlWorkUnit]]: + def get_workunits_internal(self) -> Iterable[MetadataWorkUnit]: yield from super().get_workunits_internal() if self.views_failed_parsing: diff --git a/metadata-ingestion/src/datahub/ingestion/source/sql/sql_common.py b/metadata-ingestion/src/datahub/ingestion/source/sql/sql_common.py index 4878d5c5a567..0b84dc5e2eee 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sql/sql_common.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sql/sql_common.py @@ -581,7 +581,7 @@ def get_schema_level_workunits( inspector: Inspector, schema: str, database: str, - ) -> Iterable[Union[MetadataWorkUnit, SqlWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: yield from self.gen_schema_containers(schema=schema, database=database) if self.config.include_tables: @@ -608,7 +608,7 @@ def get_schema_level_workunits( exc=e, ) - def get_workunits_internal(self) -> Iterable[Union[MetadataWorkUnit, SqlWorkUnit]]: + def get_workunits_internal(self) -> Iterable[MetadataWorkUnit]: sql_config = self.config if logger.isEnabledFor(logging.DEBUG): # If debug logging is enabled, we also want to echo each SQL query issued. @@ -775,7 +775,7 @@ def loop_tables( inspector: Inspector, schema: str, sql_config: SQLCommonConfig, - ) -> Iterable[Union[SqlWorkUnit, MetadataWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: tables_seen: Set[str] = set() data_reader = self.make_data_reader(inspector) with data_reader or contextlib.nullcontext(): @@ -843,7 +843,7 @@ def _process_table( table: str, sql_config: SQLCommonConfig, data_reader: Optional[DataReader], - ) -> Iterable[Union[SqlWorkUnit, MetadataWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: columns = self._get_columns(dataset_name, inspector, schema, table) dataset_urn = make_dataset_urn_with_platform_instance( self.platform, @@ -1191,7 +1191,7 @@ def loop_views( inspector: Inspector, schema: str, sql_config: SQLCommonConfig, - ) -> Iterable[Union[SqlWorkUnit, MetadataWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: try: for view in self._get_view_names(inspector, schema): dataset_name = self.get_identifier( @@ -1291,7 +1291,7 @@ def _process_view( schema: str, view: str, sql_config: SQLCommonConfig, - ) -> Iterable[Union[SqlWorkUnit, MetadataWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: dataset_urn = make_dataset_urn_with_platform_instance( self.platform, dataset_name, diff --git a/metadata-ingestion/src/datahub/ingestion/source/sql/teradata.py b/metadata-ingestion/src/datahub/ingestion/source/sql/teradata.py index 229b3fa1b36c..8ed5bf923a88 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sql/teradata.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sql/teradata.py @@ -76,7 +76,7 @@ DatasetContainerSubTypes, SourceCapabilityModifier, ) -from datahub.ingestion.source.sql.sql_common import SqlWorkUnit, register_custom_type +from datahub.ingestion.source.sql.sql_common import register_custom_type from datahub.ingestion.source.sql.sql_config import SQLCommonConfig from datahub.ingestion.source.sql.sql_report import SQLSourceReport from datahub.ingestion.source.sql.two_tier_sql_source import ( @@ -2364,7 +2364,7 @@ def _process_table( table: str, sql_config: SQLCommonConfig, data_reader: Optional[DataReader] = None, - ) -> Iterable[Union[SqlWorkUnit, MetadataWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: """Override to add ownership metadata based on table creator.""" yield from self._emit_ownership_if_available(dataset_name, schema, table) yield from super()._process_table( @@ -2378,7 +2378,7 @@ def _process_view( schema: str, view: str, sql_config: SQLCommonConfig, - ) -> Iterable[Union[SqlWorkUnit, MetadataWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: """Override to add ownership metadata based on view creator.""" yield from self._emit_ownership_if_available(dataset_name, schema, view) yield from super()._process_view( diff --git a/metadata-ingestion/src/datahub/ingestion/source/sql/timescaledb.py b/metadata-ingestion/src/datahub/ingestion/source/sql/timescaledb.py index 75b24d02cdb7..b1c27914cdc0 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sql/timescaledb.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sql/timescaledb.py @@ -2,7 +2,7 @@ import logging import time from datetime import datetime, timedelta -from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Union +from typing import Any, Dict, Iterable, List, Optional, Set, Tuple from pydantic import BaseModel, Field, ValidationError from sqlalchemy import text @@ -35,7 +35,6 @@ JobContainerSubTypes, ) from datahub.ingestion.source.sql.postgres import PostgresConfig, PostgresSource -from datahub.ingestion.source.sql.sql_common import SqlWorkUnit from datahub.ingestion.source.sql.sql_config import SQLCommonConfig from datahub.ingestion.source.sql.sql_utils import gen_database_key, gen_schema_key from datahub.ingestion.source.sql.stored_procedures.models import BaseProcedure @@ -656,7 +655,7 @@ def get_schema_level_workunits( inspector: Inspector, schema: str, database: str, - ) -> Iterable[Union[MetadataWorkUnit, SqlWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: yield from super().get_schema_level_workunits( inspector=inspector, schema=schema, @@ -890,7 +889,7 @@ def _process_table( table: str, sql_config: SQLCommonConfig, data_reader: Optional[DataReader], - ) -> Iterable[Union[SqlWorkUnit, MetadataWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: yield from super()._process_table( dataset_name, inspector, schema, table, sql_config, data_reader ) @@ -934,7 +933,7 @@ def _process_view( schema: str, view: str, sql_config: SQLCommonConfig, - ) -> Iterable[Union[SqlWorkUnit, MetadataWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: # The parent's _process_view already emits a single DatasetPropertiesClass # built from the overridden get_table_properties (which merges the # continuous-aggregate keys via _enrich_continuous_aggregate_properties). diff --git a/metadata-ingestion/src/datahub/ingestion/source/sql/trino.py b/metadata-ingestion/src/datahub/ingestion/source/sql/trino.py index b2251ba1c552..483adb92d082 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sql/trino.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sql/trino.py @@ -3,7 +3,7 @@ import logging import uuid from textwrap import dedent -from typing import Any, Dict, Iterable, List, Mapping, Optional, Union +from typing import Any, Dict, Iterable, List, Mapping, Optional import sqlalchemy import trino @@ -43,7 +43,6 @@ from datahub.ingestion.source.common.subtypes import SourceCapabilityModifier from datahub.ingestion.source.sql.sql_common import ( SQLAlchemySource, - SqlWorkUnit, register_custom_type, ) from datahub.ingestion.source.sql.sql_config import ( @@ -521,7 +520,7 @@ def _process_table( table: str, sql_config: SQLCommonConfig, data_reader: Optional[DataReader], - ) -> Iterable[Union[SqlWorkUnit, MetadataWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: schema_metadata: Optional[SchemaMetadataClass] = None for wu in super()._process_table( dataset_name, inspector, schema, table, sql_config, data_reader @@ -542,7 +541,7 @@ def _process_view( schema: str, view: str, sql_config: SQLCommonConfig, - ) -> Iterable[Union[SqlWorkUnit, MetadataWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: schema_metadata: Optional[SchemaMetadataClass] = None for wu in super()._process_view( dataset_name, inspector, schema, view, sql_config diff --git a/metadata-ingestion/src/datahub/ingestion/source/sql/vertica.py b/metadata-ingestion/src/datahub/ingestion/source/sql/vertica.py index 2ffc5f552c41..90d2c5b64225 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sql/vertica.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sql/vertica.py @@ -1,7 +1,7 @@ import logging import traceback from dataclasses import dataclass -from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Set, Tuple, Union +from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Set, Tuple import pydantic from pydantic import field_validator @@ -31,7 +31,6 @@ ) from datahub.ingestion.source.sql.sql_common import ( SQLAlchemySource, - SqlWorkUnit, get_schema_metadata, ) from datahub.ingestion.source.sql.sql_config import ( @@ -161,7 +160,7 @@ def get_inspectors(self) -> Iterable[VerticaInspector]: for inspector in super().get_inspectors(): yield VerticaInspector(inspector) - def get_workunits_internal(self) -> Iterable[Union[MetadataWorkUnit, SqlWorkUnit]]: + def get_workunits_internal(self) -> Iterable[MetadataWorkUnit]: yield from super().get_workunits_internal() sql_config = self.config @@ -255,7 +254,7 @@ def _process_table( table: str, sql_config: SQLCommonConfig, data_reader: Optional[DataReader], - ) -> Iterable[Union[SqlWorkUnit, MetadataWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: dataset_urn = make_dataset_urn_with_platform_instance( self.platform, dataset_name, @@ -277,7 +276,7 @@ def loop_views( inspector: Inspector, schema: str, sql_config: SQLCommonConfig, - ) -> Iterable[Union[SqlWorkUnit, MetadataWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: try: for view in inspector.get_view_names(schema): dataset_name = self.get_identifier( @@ -355,7 +354,7 @@ def _process_view( schema: str, view: str, sql_config: SQLCommonConfig, - ) -> Iterable[Union[SqlWorkUnit, MetadataWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: """ This function is used for performing operation and gets data for every view inside a schema @@ -368,10 +367,10 @@ def _process_view( table_tags (Dict[str, str], optional) Defaults to dict(). Returns: - Iterable[Union[SqlWorkUnit, MetadataWorkUnit]] + Iterable[MetadataWorkUnit] Yields: - Iterator[Iterable[Union[SqlWorkUnit, MetadataWorkUnit]]] + Iterator[Iterable[MetadataWorkUnit]] """ dataset_urn = make_dataset_urn_with_platform_instance( diff --git a/metadata-ingestion/tests/unit/test_hive_source_storage_lineage.py b/metadata-ingestion/tests/unit/test_hive_source_storage_lineage.py index 495e965d707d..e137d098e6f5 100644 --- a/metadata-ingestion/tests/unit/test_hive_source_storage_lineage.py +++ b/metadata-ingestion/tests/unit/test_hive_source_storage_lineage.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, Iterable, List, Optional, Tuple, Type, Union +from typing import Any, Dict, Iterable, List, Optional, Tuple, Type from unittest.mock import MagicMock, patch import pytest @@ -8,7 +8,7 @@ from datahub.ingestion.api.workunit import MetadataWorkUnit from datahub.ingestion.source.sql.hive.hive_source import HiveSource from datahub.ingestion.source.sql.hive.storage_lineage import HiveStorageLineage -from datahub.ingestion.source.sql.sql_common import SQLAlchemySource, SqlWorkUnit +from datahub.ingestion.source.sql.sql_common import SQLAlchemySource from datahub.ingestion.source.sql.two_tier_sql_source import TwoTierSQLAlchemySource from datahub.metadata.schema_classes import ( ContainerClass, @@ -187,7 +187,7 @@ def test_storage_lineage_without_schema_metadata() -> None: def without_schema( self: SQLAlchemySource, *args: Any, **kwargs: Any - ) -> Iterable[Union[SqlWorkUnit, MetadataWorkUnit]]: + ) -> Iterable[MetadataWorkUnit]: for wu in parent(self, *args, **kwargs): if wu.get_aspect_of_type(SchemaMetadataClass) is None: yield wu From cfd0ad1ed6a94b06dd6feb1801b56ab6f5611aad Mon Sep 17 00:00:00 2001 From: avi <252974426+aviraj-gour@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:38:09 +0530 Subject: [PATCH 03/20] test(ingest): drop dead MCE branches from connector tests Every connector now emits MCPs, so the MCE branches in these test helpers never run and the MCE-shaped ignore_paths match nothing in the MCP-only goldens. The lookml hive check only inspected MCE snapshots, so it asserted nothing; it now reads the upstreamLineage MCPs and requires at least one. --- .../tests/integration/flink/test_flink.py | 45 +++---------------- .../integration/informix/test_informix.py | 1 - .../integration/looker/lookml/test_lookml.py | 29 +++++------- .../integration/odcs/test_odcs_stateful.py | 8 ++-- .../tests/integration/s3/test_s3.py | 3 -- .../integration/snowplow/test_snowplow.py | 6 --- metadata-ingestion/tests/unit/conftest.py | 17 +++---- .../tableau/test_tableau_luid_edge_cases.py | 4 -- .../tests/unit/tableau/test_tableau_source.py | 4 -- .../tests/unit/test_vertica_workunits.py | 20 +++------ 10 files changed, 33 insertions(+), 104 deletions(-) diff --git a/metadata-ingestion/tests/integration/flink/test_flink.py b/metadata-ingestion/tests/integration/flink/test_flink.py index 5a662c622acd..4ee4b9ccb2b3 100644 --- a/metadata-ingestion/tests/integration/flink/test_flink.py +++ b/metadata-ingestion/tests/integration/flink/test_flink.py @@ -19,41 +19,13 @@ def _extract_schema_meta_urns(records: list) -> set: - """Return dataset URNs that have a schemaMetadata aspect in either format. - - The DataHub file sink serialises MetaChangeProposals (MCPs) in the modern format: - {"entityType": "dataset", "entityUrn": "...", "aspectName": "schemaMetadata", ...} - - Older SQL-based sources (including the Postgres connector) still emit - MetaChangeEvents (MCEs) in the classic Pegasus/Avro format: - {"proposedSnapshot": {"com.linkedin.pegasus2avro.metadata.snapshot.DatasetSnapshot": - {"urn": "...", "aspects": [{"com.linkedin...SchemaMetadata": {...}}]}}} - - This helper handles both so the stitching tests correctly verify schema ownership - regardless of which format the source connector uses. - """ - urns: set = set() - for record in records: - # Modern MCP format - if ( - record.get("entityType") == "dataset" - and record.get("aspectName") == "schemaMetadata" - ): - urns.add(record["entityUrn"]) - continue - # Legacy MCE format - snapshot_wrapper = record.get("proposedSnapshot") - if not snapshot_wrapper: - continue - for type_key, snapshot_data in snapshot_wrapper.items(): - if "DatasetSnapshot" not in type_key: - continue - urn = snapshot_data.get("urn", "") - for aspect in snapshot_data.get("aspects", []): - if any("SchemaMetadata" in k for k in aspect): - urns.add(urn) - break - return urns + """Return dataset URNs that have a schemaMetadata MCP.""" + return { + record["entityUrn"] + for record in records + if record.get("entityType") == "dataset" + and record.get("aspectName") == "schemaMetadata" + } FLINK_REST_URL = "http://localhost:8082" @@ -801,9 +773,6 @@ def _assert_stitching( } # Postgres connector must emit schemaMetadata for the tables it owns. - # The DataHub Postgres source emits schemaMetadata in the legacy MCE format - # (proposedSnapshot/DatasetSnapshot), so _extract_schema_meta_urns handles both - # the modern MCP and legacy MCE formats transparently. assert pg_schema_urns, ( f"[{label}] Postgres connector emitted no schemaMetadata — " "expected schema for at least one table." diff --git a/metadata-ingestion/tests/integration/informix/test_informix.py b/metadata-ingestion/tests/integration/informix/test_informix.py index 319de0e48c78..cfed50c35944 100644 --- a/metadata-ingestion/tests/integration/informix/test_informix.py +++ b/metadata-ingestion/tests/integration/informix/test_informix.py @@ -228,6 +228,5 @@ def test_informix_ingest(informix_runner, pytestconfig, test_resources_dir, tmp_ r"root\[\d+\]\['aspect'\]\['json'\]\['lastUpdatedTimestamp'\]", r"root\[\d+\]\['aspect'\]\['json'\]\['timestampMillis'\]", r"root\[\d+\]\['aspect'\]\['json'\].+\[\d+\]\['auditStamp'\]\['time'\]", - r"root\[\d+\]\['proposedSnapshot'\].+\['aspects'\].+\['created'\]\['time'\]", ], ) diff --git a/metadata-ingestion/tests/integration/looker/lookml/test_lookml.py b/metadata-ingestion/tests/integration/looker/lookml/test_lookml.py index f4cd1c2a320e..9b2a4da83924 100644 --- a/metadata-ingestion/tests/integration/looker/lookml/test_lookml.py +++ b/metadata-ingestion/tests/integration/looker/lookml/test_lookml.py @@ -10,6 +10,7 @@ from deepdiff import DeepDiff from looker_sdk.sdk.api40.models import DBConnection +from datahub.emitter.mcp import MetadataChangeProposalWrapper from datahub.ingestion.api.common import PipelineContext from datahub.ingestion.api.workunit import MetadataWorkUnit from datahub.ingestion.run.pipeline import Pipeline @@ -30,11 +31,7 @@ ) from datahub.ingestion.source.looker.lookml_refinement import LookerRefinementResolver from datahub.ingestion.source.looker.lookml_source import LookMLSource -from datahub.metadata.schema_classes import ( - DatasetSnapshotClass, - MetadataChangeEventClass, - UpstreamLineageClass, -) +from datahub.metadata.schema_classes import UpstreamLineageClass from datahub.sdk.entity import Entity from datahub.sql_parsing.schema_resolver import SchemaInfo, SchemaResolver from datahub.testing import mce_helpers @@ -799,18 +796,16 @@ def test_hive_platform_drops_ids(pytestconfig, tmp_path, mock_time): # Expect 2 warnings: "Manifest File Missing" and "Skipped View File" assert pipeline.source.get_report().warnings.total_elements == 2 - events = read_metadata_file(tmp_path / mce_out) - for mce in events: - if isinstance(mce, MetadataChangeEventClass): - if isinstance(mce.proposedSnapshot, DatasetSnapshotClass): - lineage_aspects = [ - a - for a in mce.proposedSnapshot.aspects - if isinstance(a, UpstreamLineageClass) - ] - for a in lineage_aspects: - for upstream in a.upstreams: - assert "hive." not in upstream.dataset + lineage_aspects = [ + mcp.aspect + for mcp in read_metadata_file(tmp_path / mce_out) + if isinstance(mcp, MetadataChangeProposalWrapper) + and isinstance(mcp.aspect, UpstreamLineageClass) + ] + assert lineage_aspects + for a in lineage_aspects: + for upstream in a.upstreams: + assert "hive." not in upstream.dataset @time_machine.travel(FROZEN_TIME, tick=False) diff --git a/metadata-ingestion/tests/integration/odcs/test_odcs_stateful.py b/metadata-ingestion/tests/integration/odcs/test_odcs_stateful.py index db9d0b9504e3..853c850c97b8 100644 --- a/metadata-ingestion/tests/integration/odcs/test_odcs_stateful.py +++ b/metadata-ingestion/tests/integration/odcs/test_odcs_stateful.py @@ -101,16 +101,14 @@ def _pipeline_config( def _status_removed_urns(output_path: pathlib.Path) -> List[str]: removed: List[str] = [] for record in json.loads(output_path.read_text()): - proposal = record.get("proposedSnapshot") or record - aspect_name = proposal.get("aspectName") - if aspect_name != "status": + if record.get("aspectName") != "status": continue - aspect = proposal.get("aspect", {}) + aspect = record.get("aspect", {}) payload = aspect.get("json") or aspect.get("value") if isinstance(payload, str): payload = json.loads(payload) if isinstance(payload, dict) and payload.get("removed") is True: - removed.append(proposal["entityUrn"]) + removed.append(record["entityUrn"]) return removed diff --git a/metadata-ingestion/tests/integration/s3/test_s3.py b/metadata-ingestion/tests/integration/s3/test_s3.py index 36bde196f6ed..9edf148bb365 100644 --- a/metadata-ingestion/tests/integration/s3/test_s3.py +++ b/metadata-ingestion/tests/integration/s3/test_s3.py @@ -373,10 +373,7 @@ def test_data_lake_local_ingest( ignore_paths=[ r"root\[\d+\]\['aspect'\]\['json'\]\['lastUpdatedTimestamp'\]", r"root\[\d+\]\['aspect'\]\['json'\]\[\d+\]\['value'\]\['time'\]", - r"root\[\d+\]\['proposedSnapshot'\].+\['aspects'\].+\['created'\]\['time'\]", r"root\[\d+\]\['aspect'\]\['json'\]\['fieldProfiles'\]\[\d+\]\['sampleValues'\]", - r"root\[\d+\]\['proposedSnapshot'\]\['com.linkedin.pegasus2avro.metadata.snapshot.DatasetSnapshot'\]\['aspects'\]\[\d+\]\['com.linkedin.pegasus2avro.schema.SchemaMetadata'\]\['fields'\]", - r"root\[\d+\]\['proposedSnapshot'\]\['com.linkedin.pegasus2avro.metadata.snapshot.DatasetSnapshot'\]\['aspects'\]\[\d+\]\['com.linkedin.pegasus2avro.dataset.DatasetProperties'\]\['customProperties'\]\['size_in_bytes'\]", ], ) diff --git a/metadata-ingestion/tests/integration/snowplow/test_snowplow.py b/metadata-ingestion/tests/integration/snowplow/test_snowplow.py index ec89e517ee6b..ab966fc67714 100644 --- a/metadata-ingestion/tests/integration/snowplow/test_snowplow.py +++ b/metadata-ingestion/tests/integration/snowplow/test_snowplow.py @@ -100,7 +100,6 @@ def test_snowplow_ingest(pytestconfig, tmp_path, mock_time): golden_path=golden_file, ignore_paths=[ # Ignore timestamps and run IDs - r"root\[\d+\]\['proposedSnapshot'\]\['com\.linkedin\.pegasus2avro\.metadata\.snapshot\.DatasetSnapshot'\]\['aspects'\]\[\d+\]\['com\.linkedin\.pegasus2avro\.schema\.SchemaMetadata'\]\['created'\]", r"root\[\d+\]\['systemMetadata'\]\['lastObserved'\]", r"root\[\d+\]\['systemMetadata'\]\['runId'\]", ], @@ -242,7 +241,6 @@ def test_snowplow_event_specs_and_tracking_plans(pytestconfig, tmp_path, mock_ti golden_path=golden_file, ignore_paths=[ # Ignore timestamps and run IDs - r"root\[\d+\]\['proposedSnapshot'\]\['com\.linkedin\.pegasus2avro\.metadata\.snapshot\.DatasetSnapshot'\]\['aspects'\]\[\d+\]\['com\.linkedin\.pegasus2avro\.schema\.SchemaMetadata'\]\['created'\]", r"root\[\d+\]\['systemMetadata'\]\['lastObserved'\]", r"root\[\d+\]\['systemMetadata'\]\['runId'\]", ], @@ -383,7 +381,6 @@ def test_snowplow_tracking_plans(pytestconfig, tmp_path, mock_time): golden_path=golden_file, ignore_paths=[ # Ignore timestamps and run IDs - r"root\[\d+\]\['proposedSnapshot'\]\['com\.linkedin\.pegasus2avro\.metadata\.snapshot\.DatasetSnapshot'\]\['aspects'\]\[\d+\]\['com\.linkedin\.pegasus2avro\.schema\.SchemaMetadata'\]\['created'\]", r"root\[\d+\]\['systemMetadata'\]\['lastObserved'\]", r"root\[\d+\]\['systemMetadata'\]\['runId'\]", ], @@ -489,7 +486,6 @@ def test_snowplow_pipelines(pytestconfig, tmp_path, mock_time): golden_path=golden_file, ignore_paths=[ # Ignore timestamps and run IDs - r"root\[\d+\]\['proposedSnapshot'\]\['com\.linkedin\.pegasus2avro\.metadata\.snapshot\.DatasetSnapshot'\]\['aspects'\]\[\d+\]\['com\.linkedin\.pegasus2avro\.schema\.SchemaMetadata'\]\['created'\]", r"root\[\d+\]\['systemMetadata'\]\['lastObserved'\]", r"root\[\d+\]\['systemMetadata'\]\['runId'\]", ], @@ -629,7 +625,6 @@ def test_snowplow_enrichments(pytestconfig, tmp_path, mock_time): golden_path=golden_file, ignore_paths=[ # Ignore timestamps and run IDs - r"root\[\d+\]\['proposedSnapshot'\]\['com\.linkedin\.pegasus2avro\.metadata\.snapshot\.DatasetSnapshot'\]\['aspects'\]\[\d+\]\['com\.linkedin\.pegasus2avro\.schema\.SchemaMetadata'\]\['created'\]", r"root\[\d+\]\['systemMetadata'\]\['lastObserved'\]", r"root\[\d+\]\['systemMetadata'\]\['runId'\]", ], @@ -725,7 +720,6 @@ def test_snowplow_iglu_autodiscovery( golden_path=golden_file, ignore_paths=[ # Ignore timestamps and run IDs - r"root\[\d+\]\['proposedSnapshot'\]\['com\.linkedin\.pegasus2avro\.metadata\.snapshot\.DatasetSnapshot'\]\['aspects'\]\[\d+\]\['com\.linkedin\.pegasus2avro\.schema\.SchemaMetadata'\]\['created'\]", r"root\[\d+\]\['systemMetadata'\]\['lastObserved'\]", r"root\[\d+\]\['systemMetadata'\]\['runId'\]", ], diff --git a/metadata-ingestion/tests/unit/conftest.py b/metadata-ingestion/tests/unit/conftest.py index c059006b1e1c..49f6b770624a 100644 --- a/metadata-ingestion/tests/unit/conftest.py +++ b/metadata-ingestion/tests/unit/conftest.py @@ -30,8 +30,6 @@ from datahub.ingestion.api.source import StructuredLogEntry from datahub.ingestion.api.workunit import MetadataWorkUnit from datahub.metadata.schema_classes import ( - DatasetSnapshotClass, - MetadataChangeEventClass, MetadataChangeProposalClass, _Aspect, ) @@ -92,8 +90,7 @@ def single_aspect( def aspects_by_urn(workunits: Iterable[MetadataWorkUnit]) -> Dict[str, List[_Aspect]]: - """Every aspect emitted per entity urn, whether it came as an MCP (wrapped or - raw) or inside an MCE dataset snapshot. + """Every aspect emitted per entity urn, from wrapped or raw MCPs. Raw PATCH proposals carry a JSON patch rather than an aspect, so they have nothing to decode and are not included. @@ -106,14 +103,10 @@ def aspects_by_urn(workunits: Iterable[MetadataWorkUnit]) -> Dict[str, List[_Asp if decoded is None: continue metadata = decoded - if isinstance(metadata, MetadataChangeProposalWrapper): - assert metadata.entityUrn is not None - if metadata.aspect is not None: - aspects.setdefault(metadata.entityUrn, []).append(metadata.aspect) - elif isinstance(metadata, MetadataChangeEventClass): - snapshot = metadata.proposedSnapshot - assert isinstance(snapshot, DatasetSnapshotClass) - aspects.setdefault(snapshot.urn, []).extend(snapshot.aspects) + assert isinstance(metadata, MetadataChangeProposalWrapper), type(metadata) + assert metadata.entityUrn is not None + if metadata.aspect is not None: + aspects.setdefault(metadata.entityUrn, []).append(metadata.aspect) return aspects diff --git a/metadata-ingestion/tests/unit/tableau/test_tableau_luid_edge_cases.py b/metadata-ingestion/tests/unit/tableau/test_tableau_luid_edge_cases.py index ef894b443840..623ddeb1aa5f 100644 --- a/metadata-ingestion/tests/unit/tableau/test_tableau_luid_edge_cases.py +++ b/metadata-ingestion/tests/unit/tableau/test_tableau_luid_edge_cases.py @@ -67,10 +67,6 @@ def _extract_dataset_custom_props(work_units: list) -> dict: if isinstance(wu.metadata, MetadataChangeProposalWrapper): if isinstance(wu.metadata.aspect, DatasetPropertiesClass): return wu.metadata.aspect.customProperties or {} - elif hasattr(wu.metadata, "proposedSnapshot"): - for aspect in wu.metadata.proposedSnapshot.aspects: - if isinstance(aspect, DatasetPropertiesClass): - return aspect.customProperties or {} return {} diff --git a/metadata-ingestion/tests/unit/tableau/test_tableau_source.py b/metadata-ingestion/tests/unit/tableau/test_tableau_source.py index 7d6a528a59ef..a7c9942844a5 100644 --- a/metadata-ingestion/tests/unit/tableau/test_tableau_source.py +++ b/metadata-ingestion/tests/unit/tableau/test_tableau_source.py @@ -1426,10 +1426,6 @@ def _extract_dataset_properties(work_units): wu.metadata.aspect, DatasetPropertiesClass ): return wu.metadata.aspect - elif hasattr(wu.metadata, "proposedSnapshot"): - for aspect in wu.metadata.proposedSnapshot.aspects: - if isinstance(aspect, DatasetPropertiesClass): - return aspect return None diff --git a/metadata-ingestion/tests/unit/test_vertica_workunits.py b/metadata-ingestion/tests/unit/test_vertica_workunits.py index f04222281142..544f88a7c0f0 100644 --- a/metadata-ingestion/tests/unit/test_vertica_workunits.py +++ b/metadata-ingestion/tests/unit/test_vertica_workunits.py @@ -5,15 +5,13 @@ from sqlalchemy import create_engine, inspect from datahub.emitter.mce_builder import make_dataset_urn -from datahub.emitter.mcp_builder import mcps_from_mce +from datahub.emitter.mcp import MetadataChangeProposalWrapper from datahub.ingestion.api.common import PipelineContext from datahub.ingestion.source.sql.vertica import VerticaConfig, VerticaSource from datahub.ingestion.source.sql.vertica_inspector import VerticaInspector -from datahub.metadata.schema_classes import MetadataChangeEventClass from tests.unit.test_vertica_source import _FakeConnection -# Row = (entity urn, aspect name, aspect JSON). MCEs are expanded to one row per -# snapshot aspect, in snapshot order, so the rows read the same for MCE and MCP output. +# Row = (entity urn, aspect name, aspect JSON), one per emitted MCP. Row = Tuple[str, str, Dict[str, Any]] _CATALOG: Dict[str, List[Dict[str, Any]]] = { @@ -110,16 +108,10 @@ def _run() -> List[Row]: rows: List[Row] = [] for wu in workunits: - if isinstance(wu.metadata, MetadataChangeEventClass): - # Tables and views come from SQLAlchemySource as MCEs; projections - # and models must not. - assert wu.get_urn() not in _ASPECT_ORDER - mcps = list(mcps_from_mce(wu.metadata)) - else: - mcps = [wu.metadata] # type: ignore[list-item] - for mcp in mcps: - assert mcp.entityUrn and mcp.aspectName and mcp.aspect - rows.append((mcp.entityUrn, mcp.aspectName, mcp.aspect.to_obj())) + mcp = wu.metadata + assert isinstance(mcp, MetadataChangeProposalWrapper) + assert mcp.entityUrn and mcp.aspectName and mcp.aspect + rows.append((mcp.entityUrn, mcp.aspectName, mcp.aspect.to_obj())) return rows From a0e7cc68c1dc77d48276d7b55c64ebd642860b4a Mon Sep 17 00:00:00 2001 From: avi <252974426+aviraj-gour@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:39:28 +0530 Subject: [PATCH 04/20] refactor(ingest): store the bootstrap sample data as MCPs Convert the 82 MCEs in bootstrap_mce.json to one MCP per aspect with expand_mces; the 21 records that were already MCPs are unchanged. The file holds the same (urn, aspect, systemMetadata) values in the same order, so loading it stores the same aspects; the run report now counts one record per aspect. Also delete an Azure AD golden no test reads and an example recipe that pointed at a file that does not exist. --- .../examples/mce_files/bootstrap_mce.json | 6636 ++++++++++------- .../example_to_datahub_rest2.dhub.yaml | 11 - ...ad_mces_golden_empty_group_membership.json | 285 - 3 files changed, 3838 insertions(+), 3094 deletions(-) delete mode 100644 metadata-ingestion/examples/recipes/example_to_datahub_rest2.dhub.yaml delete mode 100644 metadata-ingestion/tests/integration/azure_ad/azure_ad_mces_golden_empty_group_membership.json diff --git a/metadata-ingestion/examples/mce_files/bootstrap_mce.json b/metadata-ingestion/examples/mce_files/bootstrap_mce.json index 7fea000abb26..52bb83b87e43 100644 --- a/metadata-ingestion/examples/mce_files/bootstrap_mce.json +++ b/metadata-ingestion/examples/mce_files/bootstrap_mce.json @@ -1,26 +1,18 @@ [ { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.CorpUserSnapshot": { - "urn": "urn:li:corpuser:jdoe", - "aspects": [ - { - "com.linkedin.pegasus2avro.identity.CorpUserInfo": { - "customProperties": {}, - "active": true, - "displayName": "John Doe", - "email": "jdoe@linkedin.com", - "title": "Software Engineer", - "fullName": "John Doe", - "system": false - } - }, - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - } - ] + "entityType": "corpuser", + "entityUrn": "urn:li:corpuser:jdoe", + "changeType": "UPSERT", + "aspectName": "corpUserInfo", + "aspect": { + "json": { + "customProperties": {}, + "active": true, + "displayName": "John Doe", + "email": "jdoe@linkedin.com", + "title": "Software Engineer", + "fullName": "John Doe", + "system": false } }, "systemMetadata": { @@ -30,31 +22,13 @@ } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.CorpGroupSnapshot": { - "urn": "urn:li:corpGroup:jdoe", - "aspects": [ - { - "com.linkedin.pegasus2avro.identity.CorpGroupInfo": { - "email": "jdoe@linkedin.com", - "admins": [ - "urn:li:corpuser:jdoe", - "urn:li:corpuser:datahub" - ], - "members": [ - "urn:li:corpuser:jdoe", - "urn:li:corpuser:datahub" - ], - "groups": [], - "slack": "bfoo-squad" - } - }, - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - } - ] + "entityType": "corpuser", + "entityUrn": "urn:li:corpuser:jdoe", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { @@ -64,33 +38,67 @@ } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.CorpGroupSnapshot": { - "urn": "urn:li:corpGroup:bfoo", - "aspects": [ - { - "com.linkedin.pegasus2avro.identity.CorpGroupInfo": { - "email": "bfoo@linkedin.com", - "admins": [ - "urn:li:corpuser:jdoe", - "urn:li:corpuser:datahub" - ], - "members": [ - "urn:li:corpuser:jdoe", - "urn:li:corpuser:datahub" - ], - "groups": [ - "urn:li:corpGroup:jdoe" - ], - "description": "This group is full of bfoos!" - } - }, - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - } - ] + "entityType": "corpGroup", + "entityUrn": "urn:li:corpGroup:jdoe", + "changeType": "UPSERT", + "aspectName": "corpGroupInfo", + "aspect": { + "json": { + "email": "jdoe@linkedin.com", + "admins": [ + "urn:li:corpuser:jdoe", + "urn:li:corpuser:datahub" + ], + "members": [ + "urn:li:corpuser:jdoe", + "urn:li:corpuser:datahub" + ], + "groups": [], + "slack": "bfoo-squad" + } + }, + "systemMetadata": { + "lastObserved": 1758537741905, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "corpGroup", + "entityUrn": "urn:li:corpGroup:jdoe", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741905, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "corpGroup", + "entityUrn": "urn:li:corpGroup:bfoo", + "changeType": "UPSERT", + "aspectName": "corpGroupInfo", + "aspect": { + "json": { + "email": "bfoo@linkedin.com", + "admins": [ + "urn:li:corpuser:jdoe", + "urn:li:corpuser:datahub" + ], + "members": [ + "urn:li:corpuser:jdoe", + "urn:li:corpuser:datahub" + ], + "groups": [ + "urn:li:corpGroup:jdoe" + ], + "description": "This group is full of bfoos!" } }, "systemMetadata": { @@ -100,148 +108,55 @@ } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DatasetSnapshot": { - "urn": "urn:li:dataset:(urn:li:dataPlatform:kafka,SampleKafkaDataset,PROD)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.BrowsePaths": { - "paths": [ - "/prod/kafka/SampleKafkaDataset" - ] - } - }, - { - "com.linkedin.pegasus2avro.common.BrowsePathsV2": { - "path": [ - { - "id": "prod" - }, - { - "id": "kafka" - }, - { - "id": "SampleKafkaDataset" - } - ] - } - }, - { - "com.linkedin.pegasus2avro.dataset.DatasetProperties": { - "customProperties": { - "prop1": "fakeprop", - "prop2": "pikachu" - }, - "tags": [] - } - }, - { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ - { - "owner": "urn:li:corpuser:jdoe", - "type": "DATAOWNER" - }, - { - "owner": "urn:li:corpuser:datahub", - "type": "DATAOWNER" - } - ], - "ownerTypes": {}, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - } - } - }, + "entityType": "corpGroup", + "entityUrn": "urn:li:corpGroup:bfoo", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741906, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,SampleKafkaDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "browsePaths", + "aspect": { + "json": { + "paths": [ + "/prod/kafka/SampleKafkaDataset" + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741907, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,SampleKafkaDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "browsePathsV2", + "aspect": { + "json": { + "path": [ { - "com.linkedin.pegasus2avro.common.InstitutionalMemory": { - "elements": [ - { - "url": "https://www.linkedin.com", - "description": "Sample doc", - "createStamp": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - } - } - ] - } + "id": "prod" }, { - "com.linkedin.pegasus2avro.schema.SchemaMetadata": { - "schemaName": "SampleKafkaSchema", - "platform": "urn:li:dataPlatform:kafka", - "version": 0, - "created": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "hash": "", - "platformSchema": { - "com.linkedin.pegasus2avro.schema.KafkaSchema": { - "documentSchema": "{\"type\":\"record\",\"name\":\"SampleKafkaSchema\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"Sample Kafka dataset\",\"fields\":[{\"name\":\"field_foo\",\"type\":[\"string\"]},{\"name\":\"field_bar\",\"type\":[\"boolean\"]}]}", - "documentSchemaType": "AVRO" - } - }, - "fields": [ - { - "fieldPath": "[version=2.0].[type=boolean].field_foo_2", - "nullable": false, - "description": "Foo field description", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "varchar(100)", - "recursive": false, - "globalTags": { - "tags": [ - { - "tag": "urn:li:tag:NeedsDocumentation" - } - ] - }, - "isPartOfKey": false - }, - { - "fieldPath": "[version=2.0].[type=boolean].field_bar", - "nullable": false, - "description": "Bar field description", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "boolean", - "recursive": false, - "isPartOfKey": false - }, - { - "fieldPath": "[version=2.0].[key=True].[type=int].id", - "nullable": false, - "description": "Id specifying which partition the message should go to", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "boolean", - "recursive": false, - "isPartOfKey": false - } - ] - } + "id": "kafka" }, { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } + "id": "SampleKafkaDataset" } ] } @@ -253,645 +168,339 @@ } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DatasetSnapshot": { - "urn": "urn:li:dataset:(urn:li:dataPlatform:hdfs,SampleHdfsDataset,PROD)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.common.BrowsePaths": { - "paths": [ - "/prod/hdfs/SampleHdfsDataset" - ] - } - }, - { - "com.linkedin.pegasus2avro.common.BrowsePathsV2": { - "path": [ - { - "id": "prod" - }, - { - "id": "hdfs" - }, - { - "id": "SampleHdfsDataset" - } - ] - } - }, - { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ - { - "owner": "urn:li:corpuser:jdoe", - "type": "DATAOWNER" - }, - { - "owner": "urn:li:corpuser:datahub", - "type": "DATAOWNER" - } - ], - "ownerTypes": {}, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - } - } - }, - { - "com.linkedin.pegasus2avro.dataset.UpstreamLineage": { - "upstreams": [ - { - "auditStamp": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "dataset": "urn:li:dataset:(urn:li:dataPlatform:kafka,SampleKafkaDataset,PROD)", - "type": "TRANSFORMED" - } - ] - } - }, + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,SampleKafkaDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "datasetProperties", + "aspect": { + "json": { + "customProperties": { + "prop1": "fakeprop", + "prop2": "pikachu" + }, + "tags": [] + } + }, + "systemMetadata": { + "lastObserved": 1758537741907, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,SampleKafkaDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ { - "com.linkedin.pegasus2avro.common.InstitutionalMemory": { - "elements": [ - { - "url": "https://www.linkedin.com", - "description": "Sample doc", - "createStamp": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - } - } - ] - } + "owner": "urn:li:corpuser:jdoe", + "type": "DATAOWNER" }, { - "com.linkedin.pegasus2avro.schema.EditableSchemaMetadata": { - "created": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "editableSchemaFieldInfo": [ - { - "fieldPath": "shipment_info", - "globalTags": { - "tags": [ - { - "tag": "urn:li:tag:Legacy" - } - ] - } - } - ] - } - }, + "owner": "urn:li:corpuser:datahub", + "type": "DATAOWNER" + } + ], + "ownerTypes": {}, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + } + } + }, + "systemMetadata": { + "lastObserved": 1758537741907, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,SampleKafkaDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "institutionalMemory", + "aspect": { + "json": { + "elements": [ { - "com.linkedin.pegasus2avro.schema.SchemaMetadata": { - "schemaName": "SampleHdfsSchema", - "platform": "urn:li:dataPlatform:hdfs", - "version": 0, - "created": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "hash": "", - "platformSchema": { - "com.linkedin.pegasus2avro.schema.KafkaSchema": { - "documentSchema": "{\"type\":\"record\",\"name\":\"SampleHdfsSchema\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"Sample HDFS dataset\",\"fields\":[{\"name\":\"field_foo\",\"type\":[\"string\"]},{\"name\":\"field_bar\",\"type\":[\"boolean\"]}]}", - "documentSchemaType": "AVRO" - } - }, - "fields": [ - { - "fieldPath": "shipment_info", - "nullable": false, - "description": "Shipment info description", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.RecordType": {} - } - }, - "nativeDataType": "varchar(100)", - "recursive": false, - "isPartOfKey": false - }, - { - "fieldPath": "shipment_info.date", - "nullable": false, - "description": "Shipment info date description", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.DateType": {} - } - }, - "nativeDataType": "Date", - "recursive": false, - "isPartOfKey": false - }, - { - "fieldPath": "shipment_info.target", - "nullable": false, - "description": "Shipment info target description", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.StringType": {} - } - }, - "nativeDataType": "text", - "recursive": false, - "isPartOfKey": false - }, - { - "fieldPath": "shipment_info.destination", - "nullable": false, - "description": "Shipment info destination description", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.StringType": {} - } - }, - "nativeDataType": "varchar(100)", - "recursive": false, - "isPartOfKey": false - }, - { - "fieldPath": "shipment_info.geo_info", - "nullable": false, - "description": "Shipment info geo_info description", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.RecordType": {} - } - }, - "nativeDataType": "varchar(100)", - "recursive": false, - "isPartOfKey": false - }, - { - "fieldPath": "shipment_info.geo_info.lat", - "nullable": false, - "description": "Shipment info geo_info lat", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.NumberType": {} - } - }, - "nativeDataType": "float", - "recursive": false, - "isPartOfKey": false - }, - { - "fieldPath": "shipment_info.geo_info.lng", - "nullable": false, - "description": "Shipment info geo_info lng", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.NumberType": {} - } - }, - "nativeDataType": "float", - "recursive": false, - "isPartOfKey": false - } - ] + "url": "https://www.linkedin.com", + "description": "Sample doc", + "createStamp": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" } } ] } }, "systemMetadata": { - "lastObserved": 1758537741908, + "lastObserved": 1758537741907, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DatasetSnapshot": { - "urn": "urn:li:dataset:(urn:li:dataPlatform:hive,SampleHiveDataset,PROD)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,SampleKafkaDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "schemaMetadata", + "aspect": { + "json": { + "schemaName": "SampleKafkaSchema", + "platform": "urn:li:dataPlatform:kafka", + "version": 0, + "created": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "hash": "", + "platformSchema": { + "com.linkedin.schema.KafkaSchema": { + "documentSchema": "{\"type\":\"record\",\"name\":\"SampleKafkaSchema\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"Sample Kafka dataset\",\"fields\":[{\"name\":\"field_foo\",\"type\":[\"string\"]},{\"name\":\"field_bar\",\"type\":[\"boolean\"]}]}", + "documentSchemaType": "AVRO" + } + }, + "fields": [ { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ - { - "owner": "urn:li:corpuser:jdoe", - "type": "DATAOWNER" - }, - { - "owner": "urn:li:corpuser:datahub", - "type": "DATAOWNER" - } - ], - "ownerTypes": {}, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" + "fieldPath": "[version=2.0].[type=boolean].field_foo_2", + "nullable": false, + "description": "Foo field description", + "type": { + "type": { + "com.linkedin.schema.BooleanType": {} } - } - }, - { - "com.linkedin.pegasus2avro.dataset.UpstreamLineage": { - "upstreams": [ - { - "auditStamp": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "dataset": "urn:li:dataset:(urn:li:dataPlatform:hdfs,SampleHdfsDataset,PROD)", - "type": "TRANSFORMED" - } - ] - } - }, - { - "com.linkedin.pegasus2avro.common.InstitutionalMemory": { - "elements": [ + }, + "nativeDataType": "varchar(100)", + "recursive": false, + "globalTags": { + "tags": [ { - "url": "https://www.linkedin.com", - "description": "Sample doc", - "createStamp": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - } + "tag": "urn:li:tag:NeedsDocumentation" } ] - } + }, + "isPartOfKey": false }, { - "com.linkedin.pegasus2avro.schema.SchemaMetadata": { - "schemaName": "SampleHiveSchema", - "platform": "urn:li:dataPlatform:hive", - "version": 0, - "created": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "hash": "", - "platformSchema": { - "com.linkedin.pegasus2avro.schema.KafkaSchema": { - "documentSchema": "{\"type\":\"record\",\"name\":\"SampleHiveSchema\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"Sample Hive dataset\",\"fields\":[{\"name\":\"field_foo\",\"type\":[\"string\"]},{\"name\":\"field_bar\",\"type\":[\"boolean\"]}]}", - "documentSchemaType": "AVRO" - } - }, - "fields": [ - { - "fieldPath": "field_foo", - "nullable": false, - "description": "Foo field description", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "varchar(100)", - "recursive": false, - "isPartOfKey": true - }, - { - "fieldPath": "field_bar", - "nullable": false, - "description": "Bar field description", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "boolean", - "recursive": false, - "isPartOfKey": false - } - ] - } + "fieldPath": "[version=2.0].[type=boolean].field_bar", + "nullable": false, + "description": "Bar field description", + "type": { + "type": { + "com.linkedin.schema.BooleanType": {} + } + }, + "nativeDataType": "boolean", + "recursive": false, + "isPartOfKey": false }, { - "com.linkedin.pegasus2avro.common.GlobalTags": { - "tags": [ - { - "tag": "urn:li:tag:Legacy" - } - ] - } + "fieldPath": "[version=2.0].[key=True].[type=int].id", + "nullable": false, + "description": "Id specifying which partition the message should go to", + "type": { + "type": { + "com.linkedin.schema.BooleanType": {} + } + }, + "nativeDataType": "boolean", + "recursive": false, + "isPartOfKey": false } ] } }, "systemMetadata": { - "lastObserved": 1758537741910, + "lastObserved": 1758537741907, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DatasetSnapshot": { - "urn": "urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.dataset.DatasetProperties": { - "customProperties": { - "encoding": "utf-8" - }, - "qualifiedName": "a.b.c", - "description": "table where each row represents a single log event", - "tags": [] - } - }, - { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ - { - "owner": "urn:li:corpuser:jdoe", - "type": "DATAOWNER" - }, - { - "owner": "urn:li:corpuser:datahub", - "type": "DATAOWNER" - } - ], - "ownerTypes": {}, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - } - } - }, + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,SampleKafkaDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741907, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hdfs,SampleHdfsDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741908, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hdfs,SampleHdfsDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "browsePaths", + "aspect": { + "json": { + "paths": [ + "/prod/hdfs/SampleHdfsDataset" + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741908, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hdfs,SampleHdfsDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "browsePathsV2", + "aspect": { + "json": { + "path": [ { - "com.linkedin.pegasus2avro.dataset.UpstreamLineage": { - "upstreams": [ - { - "auditStamp": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "dataset": "urn:li:dataset:(urn:li:dataPlatform:hive,SampleHiveDataset,PROD)", - "type": "TRANSFORMED" - } - ] - } + "id": "prod" }, { - "com.linkedin.pegasus2avro.common.InstitutionalMemory": { - "elements": [ - { - "url": "https://www.linkedin.com", - "description": "Sample doc", - "createStamp": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - } - } - ] - } + "id": "hdfs" }, { - "com.linkedin.pegasus2avro.schema.SchemaMetadata": { - "schemaName": "SampleHiveSchema", - "platform": "urn:li:dataPlatform:hive", - "version": 0, - "created": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "hash": "", - "platformSchema": { - "com.linkedin.pegasus2avro.schema.KafkaSchema": { - "documentSchema": "{\"type\":\"record\",\"name\":\"SampleHiveSchema\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"Sample Hive dataset\",\"fields\":[{\"name\":\"field_foo\",\"type\":[\"string\"]},{\"name\":\"field_bar\",\"type\":[\"boolean\"]}]}", - "documentSchemaType": "AVRO" - } - }, - "fields": [ - { - "fieldPath": "event_name", - "nullable": false, - "description": "Name of your logging event", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "varchar(100)", - "recursive": false, - "isPartOfKey": false - }, - { - "fieldPath": "event_data", - "nullable": false, - "description": "Data of your event", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "boolean", - "recursive": false, - "isPartOfKey": false - }, - { - "fieldPath": "timestamp", - "nullable": false, - "description": "TS the event was ingested", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "boolean", - "recursive": false, - "isPartOfKey": false - }, - { - "fieldPath": "browser", - "nullable": false, - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.StringType": {} - } - }, - "nativeDataType": "string", - "recursive": false, - "isPartOfKey": false - } - ] - } + "id": "SampleHdfsDataset" } ] } }, "systemMetadata": { - "lastObserved": 1758537741911, + "lastObserved": 1758537741908, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DatasetSnapshot": { - "urn": "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.dataset.DatasetProperties": { - "customProperties": { - "encoding": "utf-8" - }, - "description": "table containing all the users created on a single day", - "tags": [] - } - }, + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hdfs,SampleHdfsDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ - { - "owner": "urn:li:corpuser:jdoe", - "type": "DATAOWNER" - }, - { - "owner": "urn:li:corpuser:datahub", - "type": "DATAOWNER" - } - ], - "ownerTypes": {}, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - } - } + "owner": "urn:li:corpuser:jdoe", + "type": "DATAOWNER" }, { - "com.linkedin.pegasus2avro.dataset.UpstreamLineage": { - "upstreams": [ - { - "auditStamp": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "dataset": "urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD)", - "type": "TRANSFORMED" - } - ], - "fineGrainedLineages": [ - { - "upstreamType": "FIELD_SET", - "upstreams": [ - "urn:li:schemaField:(urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD),event_data)" - ], - "downstreamType": "FIELD", - "downstreams": [ - "urn:li:schemaField:(urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD),user_name)" - ], - "confidenceScore": 1.0 - } - ] - } - }, + "owner": "urn:li:corpuser:datahub", + "type": "DATAOWNER" + } + ], + "ownerTypes": {}, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + } + } + }, + "systemMetadata": { + "lastObserved": 1758537741908, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hdfs,SampleHdfsDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "upstreamLineage", + "aspect": { + "json": { + "upstreams": [ + { + "auditStamp": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "dataset": "urn:li:dataset:(urn:li:dataPlatform:kafka,SampleKafkaDataset,PROD)", + "type": "TRANSFORMED" + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741908, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hdfs,SampleHdfsDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "institutionalMemory", + "aspect": { + "json": { + "elements": [ { - "com.linkedin.pegasus2avro.common.InstitutionalMemory": { - "elements": [ - { - "url": "https://www.linkedin.com", - "description": "Sample doc", - "createStamp": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - } - } - ] + "url": "https://www.linkedin.com", + "description": "Sample doc", + "createStamp": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" } - }, + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741908, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hdfs,SampleHdfsDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "editableSchemaMetadata", + "aspect": { + "json": { + "created": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "editableSchemaFieldInfo": [ { - "com.linkedin.pegasus2avro.schema.SchemaMetadata": { - "schemaName": "SampleHiveSchema", - "platform": "urn:li:dataPlatform:hive", - "version": 0, - "created": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "hash": "", - "platformSchema": { - "com.linkedin.pegasus2avro.schema.KafkaSchema": { - "documentSchema": "{\"type\":\"record\",\"name\":\"SampleHiveSchema\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"Sample Hive dataset\",\"fields\":[{\"name\":\"field_foo\",\"type\":[\"string\"]},{\"name\":\"field_bar\",\"type\":[\"boolean\"]}]}", - "documentSchemaType": "AVRO" - } - }, - "fields": [ - { - "fieldPath": "user_id", - "nullable": false, - "description": "Id of the user created", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "varchar(100)", - "recursive": false, - "isPartOfKey": false - }, - { - "fieldPath": "user_name", - "nullable": false, - "description": "Name of the user who signed up", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "boolean", - "recursive": false, - "isPartOfKey": false - } - ], - "foreignKeys": [ + "fieldPath": "shipment_info", + "globalTags": { + "tags": [ { - "name": "user id", - "foreignFields": [ - "urn:li:schemaField:(urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_deleted,PROD),user_id)" - ], - "sourceFields": [ - "urn:li:schemaField:(urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD),user_id)" - ], - "foreignDataset": "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_deleted,PROD)" + "tag": "urn:li:tag:Legacy" } ] } @@ -900,2687 +509,4118 @@ } }, "systemMetadata": { - "lastObserved": 1758537741912, + "lastObserved": 1758537741908, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DatasetSnapshot": { - "urn": "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_deleted,PROD)", - "aspects": [ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hdfs,SampleHdfsDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "schemaMetadata", + "aspect": { + "json": { + "schemaName": "SampleHdfsSchema", + "platform": "urn:li:dataPlatform:hdfs", + "version": 0, + "created": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "hash": "", + "platformSchema": { + "com.linkedin.schema.KafkaSchema": { + "documentSchema": "{\"type\":\"record\",\"name\":\"SampleHdfsSchema\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"Sample HDFS dataset\",\"fields\":[{\"name\":\"field_foo\",\"type\":[\"string\"]},{\"name\":\"field_bar\",\"type\":[\"boolean\"]}]}", + "documentSchemaType": "AVRO" + } + }, + "fields": [ { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } + "fieldPath": "shipment_info", + "nullable": false, + "description": "Shipment info description", + "type": { + "type": { + "com.linkedin.schema.RecordType": {} + } + }, + "nativeDataType": "varchar(100)", + "recursive": false, + "isPartOfKey": false }, { - "com.linkedin.pegasus2avro.dataset.DatasetProperties": { - "customProperties": { - "encoding": "utf-8" - }, - "description": "table containing all the users deleted on a single day", - "tags": [] - } + "fieldPath": "shipment_info.date", + "nullable": false, + "description": "Shipment info date description", + "type": { + "type": { + "com.linkedin.schema.DateType": {} + } + }, + "nativeDataType": "Date", + "recursive": false, + "isPartOfKey": false }, { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ - { - "owner": "urn:li:corpuser:jdoe", - "type": "DATAOWNER" - }, - { - "owner": "urn:li:corpuser:datahub", - "type": "DATAOWNER" - } - ], - "ownerTypes": {}, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" + "fieldPath": "shipment_info.target", + "nullable": false, + "description": "Shipment info target description", + "type": { + "type": { + "com.linkedin.schema.StringType": {} } - } + }, + "nativeDataType": "text", + "recursive": false, + "isPartOfKey": false }, { - "com.linkedin.pegasus2avro.dataset.UpstreamLineage": { - "upstreams": [ - { - "auditStamp": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "dataset": "urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD)", - "type": "TRANSFORMED" - }, - { - "auditStamp": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "dataset": "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)", - "type": "TRANSFORMED" - } - ] - } + "fieldPath": "shipment_info.destination", + "nullable": false, + "description": "Shipment info destination description", + "type": { + "type": { + "com.linkedin.schema.StringType": {} + } + }, + "nativeDataType": "varchar(100)", + "recursive": false, + "isPartOfKey": false }, { - "com.linkedin.pegasus2avro.common.InstitutionalMemory": { - "elements": [ - { - "url": "https://www.linkedin.com", - "description": "Sample doc", - "createStamp": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - } - } - ] - } + "fieldPath": "shipment_info.geo_info", + "nullable": false, + "description": "Shipment info geo_info description", + "type": { + "type": { + "com.linkedin.schema.RecordType": {} + } + }, + "nativeDataType": "varchar(100)", + "recursive": false, + "isPartOfKey": false }, { - "com.linkedin.pegasus2avro.schema.SchemaMetadata": { - "schemaName": "SampleHiveSchema", - "platform": "urn:li:dataPlatform:hive", - "version": 0, - "created": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "hash": "", - "platformSchema": { - "com.linkedin.pegasus2avro.schema.KafkaSchema": { - "documentSchema": "{\"type\":\"record\",\"name\":\"SampleHiveSchema\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"Sample Hive dataset\",\"fields\":[{\"name\":\"field_foo\",\"type\":[\"string\"]},{\"name\":\"field_bar\",\"type\":[\"boolean\"]}]}", - "documentSchemaType": "AVRO" - } - }, - "fields": [ - { - "fieldPath": "user_name", - "nullable": false, - "description": "Name of the user who was deleted", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.StringType": {} - } - }, - "nativeDataType": "varchar(100)", - "recursive": false, - "isPartOfKey": false - }, - { - "fieldPath": "timestamp", - "nullable": false, - "description": "Timestamp user was deleted at", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.NumberType": {} - } - }, - "nativeDataType": "long", - "recursive": false, - "isPartOfKey": false - }, - { - "fieldPath": "user_id", - "nullable": false, - "description": "Id of the user deleted", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.StringType": {} - } - }, - "nativeDataType": "varchar(100)", - "recursive": false, - "isPartOfKey": false - }, - { - "fieldPath": "browser_id", - "nullable": false, - "description": "Cookie attached to identify the browser", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.StringType": {} - } - }, - "nativeDataType": "varchar(100)", - "recursive": false, - "isPartOfKey": false - }, - { - "fieldPath": "session_id", - "nullable": false, - "description": "Cookie attached to identify the session", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.StringType": {} - } - }, - "nativeDataType": "varchar(100)", - "recursive": false, - "isPartOfKey": false - }, - { - "fieldPath": "deletion_reason", - "nullable": false, - "description": "Why the user chose to deactivate", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.StringType": {} - } - }, - "nativeDataType": "varchar(100)", - "recursive": false, - "isPartOfKey": false - } - ], - "primaryKeys": [ - "user_name" - ], - "foreignKeys": [ - { - "name": "user session", - "foreignFields": [ - "urn:li:schemaField:(urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD),user_id)" - ], - "sourceFields": [ - "urn:li:schemaField:(urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_deleted,PROD),user_id)" - ], - "foreignDataset": "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)" - } - ] - } + "fieldPath": "shipment_info.geo_info.lat", + "nullable": false, + "description": "Shipment info geo_info lat", + "type": { + "type": { + "com.linkedin.schema.NumberType": {} + } + }, + "nativeDataType": "float", + "recursive": false, + "isPartOfKey": false + }, + { + "fieldPath": "shipment_info.geo_info.lng", + "nullable": false, + "description": "Shipment info geo_info lng", + "type": { + "type": { + "com.linkedin.schema.NumberType": {} + } + }, + "nativeDataType": "float", + "recursive": false, + "isPartOfKey": false } ] } }, "systemMetadata": { - "lastObserved": 1758537741913, + "lastObserved": 1758537741908, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataJobSnapshot": { - "urn": "urn:li:dataJob:(urn:li:dataFlow:(airflow,dag_abc,PROD),task_123)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ - { - "owner": "urn:li:corpuser:datahub", - "type": "DATAOWNER" - } - ], - "ownerTypes": {}, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:datahub" - } - } - }, - { - "com.linkedin.pegasus2avro.datajob.DataJobInfo": { - "customProperties": {}, - "name": "User Creations", - "description": "Constructs the fct_users_created from logging_events", - "type": { - "string": "SQL" - }, - "flowUrn": "urn:li:dataFlow:(airflow,dag_abc,PROD)" - } - }, - { - "com.linkedin.pegasus2avro.datajob.DataJobInputOutput": { - "inputDatasets": [ - "urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD)" - ], - "outputDatasets": [ - "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)" - ] - } - } - ] + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,SampleHiveDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741914, + "lastObserved": 1758537741910, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataJobSnapshot": { - "urn": "urn:li:dataJob:(urn:li:dataFlow:(airflow,dag_abc,PROD),task_456)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ - { - "owner": "urn:li:corpuser:datahub", - "type": "DATAOWNER" - } - ], - "ownerTypes": {}, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:datahub" - } - } - }, + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,SampleHiveDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ { - "com.linkedin.pegasus2avro.datajob.DataJobInfo": { - "customProperties": {}, - "name": "User Deletions", - "description": "Constructs the fct_users_deleted from logging_events", - "type": { - "string": "SQL" - }, - "flowUrn": "urn:li:dataFlow:(airflow,dag_abc,PROD)" - } + "owner": "urn:li:corpuser:jdoe", + "type": "DATAOWNER" }, { - "com.linkedin.pegasus2avro.datajob.DataJobInputOutput": { - "inputDatasets": [ - "urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD)" - ], - "outputDatasets": [ - "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_deleted,PROD)" - ], - "inputDatajobs": [ - "urn:li:dataJob:(urn:li:dataFlow:(airflow,dag_abc,PROD),task_123)" - ] - } + "owner": "urn:li:corpuser:datahub", + "type": "DATAOWNER" } + ], + "ownerTypes": {}, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + } + } + }, + "systemMetadata": { + "lastObserved": 1758537741910, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,SampleHiveDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "upstreamLineage", + "aspect": { + "json": { + "upstreams": [ + { + "auditStamp": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "dataset": "urn:li:dataset:(urn:li:dataPlatform:hdfs,SampleHdfsDataset,PROD)", + "type": "TRANSFORMED" + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741910, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,SampleHiveDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "institutionalMemory", + "aspect": { + "json": { + "elements": [ + { + "url": "https://www.linkedin.com", + "description": "Sample doc", + "createStamp": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + } + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741910, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,SampleHiveDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "schemaMetadata", + "aspect": { + "json": { + "schemaName": "SampleHiveSchema", + "platform": "urn:li:dataPlatform:hive", + "version": 0, + "created": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "hash": "", + "platformSchema": { + "com.linkedin.schema.KafkaSchema": { + "documentSchema": "{\"type\":\"record\",\"name\":\"SampleHiveSchema\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"Sample Hive dataset\",\"fields\":[{\"name\":\"field_foo\",\"type\":[\"string\"]},{\"name\":\"field_bar\",\"type\":[\"boolean\"]}]}", + "documentSchemaType": "AVRO" + } + }, + "fields": [ + { + "fieldPath": "field_foo", + "nullable": false, + "description": "Foo field description", + "type": { + "type": { + "com.linkedin.schema.BooleanType": {} + } + }, + "nativeDataType": "varchar(100)", + "recursive": false, + "isPartOfKey": true + }, + { + "fieldPath": "field_bar", + "nullable": false, + "description": "Bar field description", + "type": { + "type": { + "com.linkedin.schema.BooleanType": {} + } + }, + "nativeDataType": "boolean", + "recursive": false, + "isPartOfKey": false + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741910, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,SampleHiveDataset,PROD)", + "changeType": "UPSERT", + "aspectName": "globalTags", + "aspect": { + "json": { + "tags": [ + { + "tag": "urn:li:tag:Legacy" + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741910, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741911, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD)", + "changeType": "UPSERT", + "aspectName": "datasetProperties", + "aspect": { + "json": { + "customProperties": { + "encoding": "utf-8" + }, + "qualifiedName": "a.b.c", + "description": "table where each row represents a single log event", + "tags": [] + } + }, + "systemMetadata": { + "lastObserved": 1758537741911, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD)", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ + { + "owner": "urn:li:corpuser:jdoe", + "type": "DATAOWNER" + }, + { + "owner": "urn:li:corpuser:datahub", + "type": "DATAOWNER" + } + ], + "ownerTypes": {}, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + } + } + }, + "systemMetadata": { + "lastObserved": 1758537741911, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD)", + "changeType": "UPSERT", + "aspectName": "upstreamLineage", + "aspect": { + "json": { + "upstreams": [ + { + "auditStamp": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "dataset": "urn:li:dataset:(urn:li:dataPlatform:hive,SampleHiveDataset,PROD)", + "type": "TRANSFORMED" + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741911, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD)", + "changeType": "UPSERT", + "aspectName": "institutionalMemory", + "aspect": { + "json": { + "elements": [ + { + "url": "https://www.linkedin.com", + "description": "Sample doc", + "createStamp": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + } + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741911, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD)", + "changeType": "UPSERT", + "aspectName": "schemaMetadata", + "aspect": { + "json": { + "schemaName": "SampleHiveSchema", + "platform": "urn:li:dataPlatform:hive", + "version": 0, + "created": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "hash": "", + "platformSchema": { + "com.linkedin.schema.KafkaSchema": { + "documentSchema": "{\"type\":\"record\",\"name\":\"SampleHiveSchema\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"Sample Hive dataset\",\"fields\":[{\"name\":\"field_foo\",\"type\":[\"string\"]},{\"name\":\"field_bar\",\"type\":[\"boolean\"]}]}", + "documentSchemaType": "AVRO" + } + }, + "fields": [ + { + "fieldPath": "event_name", + "nullable": false, + "description": "Name of your logging event", + "type": { + "type": { + "com.linkedin.schema.BooleanType": {} + } + }, + "nativeDataType": "varchar(100)", + "recursive": false, + "isPartOfKey": false + }, + { + "fieldPath": "event_data", + "nullable": false, + "description": "Data of your event", + "type": { + "type": { + "com.linkedin.schema.BooleanType": {} + } + }, + "nativeDataType": "boolean", + "recursive": false, + "isPartOfKey": false + }, + { + "fieldPath": "timestamp", + "nullable": false, + "description": "TS the event was ingested", + "type": { + "type": { + "com.linkedin.schema.BooleanType": {} + } + }, + "nativeDataType": "boolean", + "recursive": false, + "isPartOfKey": false + }, + { + "fieldPath": "browser", + "nullable": false, + "type": { + "type": { + "com.linkedin.schema.StringType": {} + } + }, + "nativeDataType": "string", + "recursive": false, + "isPartOfKey": false + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741911, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741912, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)", + "changeType": "UPSERT", + "aspectName": "datasetProperties", + "aspect": { + "json": { + "customProperties": { + "encoding": "utf-8" + }, + "description": "table containing all the users created on a single day", + "tags": [] + } + }, + "systemMetadata": { + "lastObserved": 1758537741912, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ + { + "owner": "urn:li:corpuser:jdoe", + "type": "DATAOWNER" + }, + { + "owner": "urn:li:corpuser:datahub", + "type": "DATAOWNER" + } + ], + "ownerTypes": {}, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + } + } + }, + "systemMetadata": { + "lastObserved": 1758537741912, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)", + "changeType": "UPSERT", + "aspectName": "upstreamLineage", + "aspect": { + "json": { + "upstreams": [ + { + "auditStamp": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "dataset": "urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD)", + "type": "TRANSFORMED" + } + ], + "fineGrainedLineages": [ + { + "upstreamType": "FIELD_SET", + "upstreams": [ + "urn:li:schemaField:(urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD),event_data)" + ], + "downstreamType": "FIELD", + "downstreams": [ + "urn:li:schemaField:(urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD),user_name)" + ], + "confidenceScore": 1.0 + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741912, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)", + "changeType": "UPSERT", + "aspectName": "institutionalMemory", + "aspect": { + "json": { + "elements": [ + { + "url": "https://www.linkedin.com", + "description": "Sample doc", + "createStamp": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + } + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741912, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)", + "changeType": "UPSERT", + "aspectName": "schemaMetadata", + "aspect": { + "json": { + "schemaName": "SampleHiveSchema", + "platform": "urn:li:dataPlatform:hive", + "version": 0, + "created": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "hash": "", + "platformSchema": { + "com.linkedin.schema.KafkaSchema": { + "documentSchema": "{\"type\":\"record\",\"name\":\"SampleHiveSchema\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"Sample Hive dataset\",\"fields\":[{\"name\":\"field_foo\",\"type\":[\"string\"]},{\"name\":\"field_bar\",\"type\":[\"boolean\"]}]}", + "documentSchemaType": "AVRO" + } + }, + "fields": [ + { + "fieldPath": "user_id", + "nullable": false, + "description": "Id of the user created", + "type": { + "type": { + "com.linkedin.schema.BooleanType": {} + } + }, + "nativeDataType": "varchar(100)", + "recursive": false, + "isPartOfKey": false + }, + { + "fieldPath": "user_name", + "nullable": false, + "description": "Name of the user who signed up", + "type": { + "type": { + "com.linkedin.schema.BooleanType": {} + } + }, + "nativeDataType": "boolean", + "recursive": false, + "isPartOfKey": false + } + ], + "foreignKeys": [ + { + "name": "user id", + "foreignFields": [ + "urn:li:schemaField:(urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_deleted,PROD),user_id)" + ], + "sourceFields": [ + "urn:li:schemaField:(urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD),user_id)" + ], + "foreignDataset": "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_deleted,PROD)" + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741912, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_deleted,PROD)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741913, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_deleted,PROD)", + "changeType": "UPSERT", + "aspectName": "datasetProperties", + "aspect": { + "json": { + "customProperties": { + "encoding": "utf-8" + }, + "description": "table containing all the users deleted on a single day", + "tags": [] + } + }, + "systemMetadata": { + "lastObserved": 1758537741913, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_deleted,PROD)", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ + { + "owner": "urn:li:corpuser:jdoe", + "type": "DATAOWNER" + }, + { + "owner": "urn:li:corpuser:datahub", + "type": "DATAOWNER" + } + ], + "ownerTypes": {}, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + } + } + }, + "systemMetadata": { + "lastObserved": 1758537741913, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_deleted,PROD)", + "changeType": "UPSERT", + "aspectName": "upstreamLineage", + "aspect": { + "json": { + "upstreams": [ + { + "auditStamp": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "dataset": "urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD)", + "type": "TRANSFORMED" + }, + { + "auditStamp": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "dataset": "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)", + "type": "TRANSFORMED" + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741913, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_deleted,PROD)", + "changeType": "UPSERT", + "aspectName": "institutionalMemory", + "aspect": { + "json": { + "elements": [ + { + "url": "https://www.linkedin.com", + "description": "Sample doc", + "createStamp": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + } + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741913, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_deleted,PROD)", + "changeType": "UPSERT", + "aspectName": "schemaMetadata", + "aspect": { + "json": { + "schemaName": "SampleHiveSchema", + "platform": "urn:li:dataPlatform:hive", + "version": 0, + "created": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "hash": "", + "platformSchema": { + "com.linkedin.schema.KafkaSchema": { + "documentSchema": "{\"type\":\"record\",\"name\":\"SampleHiveSchema\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"Sample Hive dataset\",\"fields\":[{\"name\":\"field_foo\",\"type\":[\"string\"]},{\"name\":\"field_bar\",\"type\":[\"boolean\"]}]}", + "documentSchemaType": "AVRO" + } + }, + "fields": [ + { + "fieldPath": "user_name", + "nullable": false, + "description": "Name of the user who was deleted", + "type": { + "type": { + "com.linkedin.schema.StringType": {} + } + }, + "nativeDataType": "varchar(100)", + "recursive": false, + "isPartOfKey": false + }, + { + "fieldPath": "timestamp", + "nullable": false, + "description": "Timestamp user was deleted at", + "type": { + "type": { + "com.linkedin.schema.NumberType": {} + } + }, + "nativeDataType": "long", + "recursive": false, + "isPartOfKey": false + }, + { + "fieldPath": "user_id", + "nullable": false, + "description": "Id of the user deleted", + "type": { + "type": { + "com.linkedin.schema.StringType": {} + } + }, + "nativeDataType": "varchar(100)", + "recursive": false, + "isPartOfKey": false + }, + { + "fieldPath": "browser_id", + "nullable": false, + "description": "Cookie attached to identify the browser", + "type": { + "type": { + "com.linkedin.schema.StringType": {} + } + }, + "nativeDataType": "varchar(100)", + "recursive": false, + "isPartOfKey": false + }, + { + "fieldPath": "session_id", + "nullable": false, + "description": "Cookie attached to identify the session", + "type": { + "type": { + "com.linkedin.schema.StringType": {} + } + }, + "nativeDataType": "varchar(100)", + "recursive": false, + "isPartOfKey": false + }, + { + "fieldPath": "deletion_reason", + "nullable": false, + "description": "Why the user chose to deactivate", + "type": { + "type": { + "com.linkedin.schema.StringType": {} + } + }, + "nativeDataType": "varchar(100)", + "recursive": false, + "isPartOfKey": false + } + ], + "primaryKeys": [ + "user_name" + ], + "foreignKeys": [ + { + "name": "user session", + "foreignFields": [ + "urn:li:schemaField:(urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD),user_id)" + ], + "sourceFields": [ + "urn:li:schemaField:(urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_deleted,PROD),user_id)" + ], + "foreignDataset": "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)" + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741913, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataJob", + "entityUrn": "urn:li:dataJob:(urn:li:dataFlow:(airflow,dag_abc,PROD),task_123)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741914, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataJob", + "entityUrn": "urn:li:dataJob:(urn:li:dataFlow:(airflow,dag_abc,PROD),task_123)", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ + { + "owner": "urn:li:corpuser:datahub", + "type": "DATAOWNER" + } + ], + "ownerTypes": {}, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:datahub" + } + } + }, + "systemMetadata": { + "lastObserved": 1758537741914, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataJob", + "entityUrn": "urn:li:dataJob:(urn:li:dataFlow:(airflow,dag_abc,PROD),task_123)", + "changeType": "UPSERT", + "aspectName": "dataJobInfo", + "aspect": { + "json": { + "customProperties": {}, + "name": "User Creations", + "description": "Constructs the fct_users_created from logging_events", + "type": { + "string": "SQL" + }, + "flowUrn": "urn:li:dataFlow:(airflow,dag_abc,PROD)" + } + }, + "systemMetadata": { + "lastObserved": 1758537741914, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataJob", + "entityUrn": "urn:li:dataJob:(urn:li:dataFlow:(airflow,dag_abc,PROD),task_123)", + "changeType": "UPSERT", + "aspectName": "dataJobInputOutput", + "aspect": { + "json": { + "inputDatasets": [ + "urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD)" + ], + "outputDatasets": [ + "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)" + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741914, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataJob", + "entityUrn": "urn:li:dataJob:(urn:li:dataFlow:(airflow,dag_abc,PROD),task_456)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741915, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataJob", + "entityUrn": "urn:li:dataJob:(urn:li:dataFlow:(airflow,dag_abc,PROD),task_456)", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ + { + "owner": "urn:li:corpuser:datahub", + "type": "DATAOWNER" + } + ], + "ownerTypes": {}, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:datahub" + } + } + }, + "systemMetadata": { + "lastObserved": 1758537741915, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataJob", + "entityUrn": "urn:li:dataJob:(urn:li:dataFlow:(airflow,dag_abc,PROD),task_456)", + "changeType": "UPSERT", + "aspectName": "dataJobInfo", + "aspect": { + "json": { + "customProperties": {}, + "name": "User Deletions", + "description": "Constructs the fct_users_deleted from logging_events", + "type": { + "string": "SQL" + }, + "flowUrn": "urn:li:dataFlow:(airflow,dag_abc,PROD)" + } + }, + "systemMetadata": { + "lastObserved": 1758537741915, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataJob", + "entityUrn": "urn:li:dataJob:(urn:li:dataFlow:(airflow,dag_abc,PROD),task_456)", + "changeType": "UPSERT", + "aspectName": "dataJobInputOutput", + "aspect": { + "json": { + "inputDatasets": [ + "urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD)" + ], + "outputDatasets": [ + "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_deleted,PROD)" + ], + "inputDatajobs": [ + "urn:li:dataJob:(urn:li:dataFlow:(airflow,dag_abc,PROD),task_123)" + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741915, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataFlow", + "entityUrn": "urn:li:dataFlow:(airflow,dag_abc,PROD)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741915, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataFlow", + "entityUrn": "urn:li:dataFlow:(airflow,dag_abc,PROD)", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ + { + "owner": "urn:li:corpuser:datahub", + "type": "DATAOWNER" + } + ], + "ownerTypes": {}, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:datahub" + } + } + }, + "systemMetadata": { + "lastObserved": 1758537741915, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataFlow", + "entityUrn": "urn:li:dataFlow:(airflow,dag_abc,PROD)", + "changeType": "UPSERT", + "aspectName": "dataFlowInfo", + "aspect": { + "json": { + "customProperties": {}, + "name": "Users", + "description": "Constructs the fct_users_deleted and fct_users_created tables" + } + }, + "systemMetadata": { + "lastObserved": 1758537741915, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "chart", + "entityUrn": "urn:li:chart:(looker,baz1)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741916, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "chart", + "entityUrn": "urn:li:chart:(looker,baz1)", + "changeType": "UPSERT", + "aspectName": "chartInfo", + "aspect": { + "json": { + "customProperties": {}, + "title": "Baz Chart 1", + "description": "Baz Chart 1", + "lastModified": { + "created": { + "time": 1742778000000, + "actor": "urn:li:corpuser:jdoe" + }, + "lastModified": { + "time": 1742778000000, + "actor": "urn:li:corpuser:datahub" + } + }, + "inputs": [ + { + "string": "urn:li:dataset:(urn:li:dataPlatform:kafka,SampleKafkaDataset,PROD)" + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741916, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "chart", + "entityUrn": "urn:li:chart:(looker,baz1)", + "changeType": "UPSERT", + "aspectName": "globalTags", + "aspect": { + "json": { + "tags": [ + { + "tag": "urn:li:tag:Legacy" + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741916, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "chart", + "entityUrn": "urn:li:chart:(looker,baz2)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741916, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "chart", + "entityUrn": "urn:li:chart:(looker,baz2)", + "changeType": "UPSERT", + "aspectName": "chartInfo", + "aspect": { + "json": { + "customProperties": {}, + "title": "Baz Chart 2", + "description": "Baz Chart 2", + "lastModified": { + "created": { + "time": 1742778000000, + "actor": "urn:li:corpuser:jdoe" + }, + "lastModified": { + "time": 1742778000000, + "actor": "urn:li:corpuser:datahub" + } + }, + "inputs": [ + { + "string": "urn:li:dataset:(urn:li:dataPlatform:hdfs,SampleHdfsDataset,PROD)" + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741916, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dashboard", + "entityUrn": "urn:li:dashboard:(looker,baz)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741916, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dashboard", + "entityUrn": "urn:li:dashboard:(looker,baz)", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ + { + "owner": "urn:li:corpGroup:bfoo", + "type": "DATAOWNER" + } + ], + "ownerTypes": {}, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + } + } + }, + "systemMetadata": { + "lastObserved": 1758537741916, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dashboard", + "entityUrn": "urn:li:dashboard:(looker,baz)", + "changeType": "UPSERT", + "aspectName": "dashboardInfo", + "aspect": { + "json": { + "customProperties": { + "prop1": "fakeprop", + "prop2": "pikachu" + }, + "title": "Baz Dashboard", + "description": "Baz Dashboard", + "charts": [ + "urn:li:chart:(looker,baz1)", + "urn:li:chart:(looker,baz2)" + ], + "datasets": [], + "dashboards": [], + "lastModified": { + "created": { + "time": 1742778000000, + "actor": "urn:li:corpuser:jdoe" + }, + "lastModified": { + "time": 1742778000000, + "actor": "urn:li:corpuser:datahub" + } + } + } + }, + "systemMetadata": { + "lastObserved": 1758537741916, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlModel", + "entityUrn": "urn:li:mlModel:(urn:li:dataPlatform:science,scienceModel,PROD)", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ + { + "owner": "urn:li:corpuser:jdoe", + "type": "DATAOWNER" + }, + { + "owner": "urn:li:corpuser:datahub", + "type": "DATAOWNER" + } + ], + "ownerTypes": {}, + "lastModified": { + "time": 1742778000000, + "actor": "urn:li:corpuser:jdoe" + } + } + }, + "systemMetadata": { + "lastObserved": 1758537741917, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlModel", + "entityUrn": "urn:li:mlModel:(urn:li:dataPlatform:science,scienceModel,PROD)", + "changeType": "UPSERT", + "aspectName": "mlModelProperties", + "aspect": { + "json": { + "customProperties": {}, + "description": "A sample model for predicting some outcome.", + "type": "Naive Bayes classifier", + "tags": [ + "Sample" + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741917, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlModel", + "entityUrn": "urn:li:mlModel:(urn:li:dataPlatform:science,scienceModel,PROD)", + "changeType": "UPSERT", + "aspectName": "mlModelTrainingData", + "aspect": { + "json": { + "trainingData": [ + { + "dataset": "urn:li:dataset:(urn:li:dataPlatform:hive,pageViewsHive,PROD)", + "motivation": "For science!", + "preProcessing": [ + "Aggregation" + ] + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741917, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlModel", + "entityUrn": "urn:li:mlModel:(urn:li:dataPlatform:science,scienceModel,PROD)", + "changeType": "UPSERT", + "aspectName": "mlModelEvaluationData", + "aspect": { + "json": { + "evaluationData": [ + { + "dataset": "urn:li:dataset:(urn:li:dataPlatform:hive,pageViewsHive,PROD)" + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741917, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlModel", + "entityUrn": "urn:li:mlModel:(urn:li:dataPlatform:science,scienceModel,PROD)", + "changeType": "UPSERT", + "aspectName": "institutionalMemory", + "aspect": { + "json": { + "elements": [ + { + "url": "https://www.linkedin.com", + "description": "Sample doc", + "createStamp": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + } + } + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741917, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlModel", + "entityUrn": "urn:li:mlModel:(urn:li:dataPlatform:science,scienceModel,PROD)", + "changeType": "UPSERT", + "aspectName": "intendedUse", + "aspect": { + "json": { + "primaryUses": [ + "Sample Model", + "Primary Use" + ], + "primaryUsers": [ + "ENTERPRISE" + ], + "outOfScopeUses": [ + "Production Deployment" + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741917, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlModel", + "entityUrn": "urn:li:mlModel:(urn:li:dataPlatform:science,scienceModel,PROD)", + "changeType": "UPSERT", + "aspectName": "mlModelMetrics", + "aspect": { + "json": { + "performanceMeasures": [ + "performanceMeasures" + ], + "decisionThreshold": [ + "decisionThreshold" + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741917, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlModel", + "entityUrn": "urn:li:mlModel:(urn:li:dataPlatform:science,scienceModel,PROD)", + "changeType": "UPSERT", + "aspectName": "mlModelEthicalConsiderations", + "aspect": { + "json": { + "data": [ + "data" + ], + "humanLife": [ + "humanLife" + ], + "mitigations": [ + "mitigations" + ], + "risksAndHarms": [ + "risksAndHarms" + ], + "useCases": [ + "useCases" + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741917, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlModel", + "entityUrn": "urn:li:mlModel:(urn:li:dataPlatform:science,scienceModel,PROD)", + "changeType": "UPSERT", + "aspectName": "mlModelCaveatsAndRecommendations", + "aspect": { + "json": { + "recommendations": "recommendations", + "idealDatasetCharacteristics": [ + "idealDatasetCharacteristics" + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741917, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlModel", + "entityUrn": "urn:li:mlModel:(urn:li:dataPlatform:science,scienceModel,PROD)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741917, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlModel", + "entityUrn": "urn:li:mlModel:(urn:li:dataPlatform:science,scienceModel,PROD)", + "changeType": "UPSERT", + "aspectName": "cost", + "aspect": { + "json": { + "costType": "ORG_COST_TYPE", + "cost": { + "costCode": "sampleCostCode" + } + } + }, + "systemMetadata": { + "lastObserved": 1758537741917, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "tag", + "entityUrn": "urn:li:tag:Legacy", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741918, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "tag", + "entityUrn": "urn:li:tag:Legacy", + "changeType": "UPSERT", + "aspectName": "tagProperties", + "aspect": { + "json": { + "name": "Legacy", + "description": "Indicates the dataset is no longer supported" + } + }, + "systemMetadata": { + "lastObserved": 1758537741918, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "tag", + "entityUrn": "urn:li:tag:Legacy", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ + { + "owner": "urn:li:corpuser:jdoe", + "type": "DATAOWNER" + } + ], + "ownerTypes": {}, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + } + } + }, + "systemMetadata": { + "lastObserved": 1758537741918, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "tag", + "entityUrn": "urn:li:tag:NeedsDocumentation", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741918, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "tag", + "entityUrn": "urn:li:tag:NeedsDocumentation", + "changeType": "UPSERT", + "aspectName": "tagProperties", + "aspect": { + "json": { + "name": "NeedsDocumentation", + "description": "Indicates the data element needs documentation" + } + }, + "systemMetadata": { + "lastObserved": 1758537741918, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "tag", + "entityUrn": "urn:li:tag:NeedsDocumentation", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ + { + "owner": "urn:li:corpuser:jdoe", + "type": "DATAOWNER" + } + ], + "ownerTypes": {}, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + } + } + }, + "systemMetadata": { + "lastObserved": 1758537741918, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:adlsGen1", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "adlsGen1", + "displayName": "Azure Data Lake (Gen 1)", + "type": "FILE_SYSTEM", + "datasetNameDelimiter": "/", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/adlslogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741919, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:adlsGen2", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "adlsGen2", + "displayName": "Azure Data Lake (Gen 2)", + "type": "FILE_SYSTEM", + "datasetNameDelimiter": "/", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/adlslogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741919, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:ambry", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "ambry", + "displayName": "Ambry", + "type": "OBJECT_STORE", + "datasetNameDelimiter": "." + } + }, + "systemMetadata": { + "lastObserved": 1758537741919, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:couchbase", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "couchbase", + "displayName": "Couchbase", + "type": "KEY_VALUE_STORE", + "datasetNameDelimiter": ".", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/couchbaselogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741919, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:external", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "external", + "displayName": "External Source", + "type": "OTHERS", + "datasetNameDelimiter": "." + } + }, + "systemMetadata": { + "lastObserved": 1758537741919, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:hdfs", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "hdfs", + "displayName": "HDFS", + "type": "FILE_SYSTEM", + "datasetNameDelimiter": "/", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/hadooplogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741920, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:hive", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "hive", + "displayName": "Hive", + "type": "FILE_SYSTEM", + "datasetNameDelimiter": ".", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/hivelogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741920, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:s3", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "s3", + "displayName": "AWS S3", + "type": "FILE_SYSTEM", + "datasetNameDelimiter": "/", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/s3.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741920, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:kafka", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "kafka", + "displayName": "Kafka", + "type": "MESSAGE_BROKER", + "datasetNameDelimiter": ".", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/kafkalogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741920, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:kusto", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "kusto", + "displayName": "Kusto", + "type": "OLAP_DATASTORE", + "datasetNameDelimiter": ".", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/kustologo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741920, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:mongodb", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "mongodb", + "displayName": "MongoDB", + "type": "KEY_VALUE_STORE", + "datasetNameDelimiter": ".", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/mongodblogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741921, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:mysql", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "mysql", + "displayName": "MySQL", + "type": "RELATIONAL_DB", + "datasetNameDelimiter": ".", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/mysqllogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741921, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:oracle", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "oracle", + "displayName": "Oracle", + "type": "RELATIONAL_DB", + "datasetNameDelimiter": ".", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/oraclelogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741921, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:pinot", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "pinot", + "displayName": "Pinot", + "type": "OLAP_DATASTORE", + "datasetNameDelimiter": ".", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/pinotlogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741921, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:postgres", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "postgres", + "displayName": "PostgreSQL", + "type": "RELATIONAL_DB", + "datasetNameDelimiter": ".", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/postgreslogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741921, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:presto", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "presto", + "displayName": "Presto", + "type": "QUERY_ENGINE", + "datasetNameDelimiter": ".", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/prestologo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741921, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:teradata", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "teradata", + "displayName": "Teradata", + "type": "RELATIONAL_DB", + "datasetNameDelimiter": ".", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/teradatalogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741922, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:voldemort", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "voldemort", + "displayName": "Voldemort", + "type": "KEY_VALUE_STORE", + "datasetNameDelimiter": "." + } + }, + "systemMetadata": { + "lastObserved": 1758537741922, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:snowflake", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "snowflake", + "displayName": "Snowflake", + "type": "RELATIONAL_DB", + "datasetNameDelimiter": ".", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/snowflakelogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741922, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:redshift", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "redshift", + "displayName": "Redshift", + "type": "RELATIONAL_DB", + "datasetNameDelimiter": ".", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/redshiftlogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741922, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:mssql", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "mssql", + "displayName": "SQL Server", + "type": "RELATIONAL_DB", + "datasetNameDelimiter": ".", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/mssqllogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741922, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:bigquery", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "bigquery", + "displayName": "BigQuery", + "type": "RELATIONAL_DB", + "datasetNameDelimiter": ".", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/bigquerylogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741923, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:druid", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "druid", + "displayName": "Druid", + "type": "OLAP_DATASTORE", + "datasetNameDelimiter": ".", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/druidlogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741923, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:looker", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "looker", + "displayName": "Looker", + "type": "OTHERS", + "datasetNameDelimiter": ".", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/lookerlogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741923, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:feast", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "feast", + "displayName": "Feast", + "type": "OTHERS", + "datasetNameDelimiter": ".", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/feastlogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741923, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:sagemaker", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "sagemaker", + "displayName": "SageMaker", + "type": "OTHERS", + "datasetNameDelimiter": ".", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/sagemakerlogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741923, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:glue", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "name": "glue", + "displayName": "Glue", + "type": "OTHERS", + "datasetNameDelimiter": ".", + "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/gluelogo.png" + } + }, + "systemMetadata": { + "lastObserved": 1758537741923, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlPrimaryKey", + "entityUrn": "urn:li:mlPrimaryKey:(test_feature_table_all_feature_dtypes,dummy_entity_1)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741924, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlPrimaryKey", + "entityUrn": "urn:li:mlPrimaryKey:(test_feature_table_all_feature_dtypes,dummy_entity_1)", + "changeType": "UPSERT", + "aspectName": "mlPrimaryKeyProperties", + "aspect": { + "json": { + "customProperties": {}, + "description": "Dummy entity 1", + "dataType": "TEXT", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741924, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlPrimaryKey", + "entityUrn": "urn:li:mlPrimaryKey:(test_feature_table_all_feature_dtypes,dummy_entity_2)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741924, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlPrimaryKey", + "entityUrn": "urn:li:mlPrimaryKey:(test_feature_table_all_feature_dtypes,dummy_entity_2)", + "changeType": "UPSERT", + "aspectName": "mlPrimaryKeyProperties", + "aspect": { + "json": { + "customProperties": {}, + "description": "Dummy entity 2", + "dataType": "ORDINAL", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741924, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_BOOL_LIST_feature)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741924, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_BOOL_LIST_feature)", + "changeType": "UPSERT", + "aspectName": "mlFeatureProperties", + "aspect": { + "json": { + "customProperties": {}, + "dataType": "SEQUENCE", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741924, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_BOOL_feature)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741924, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_BOOL_feature)", + "changeType": "UPSERT", + "aspectName": "mlFeatureProperties", + "aspect": { + "json": { + "customProperties": {}, + "dataType": "BINARY", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741924, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_BYTES_LIST_feature)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741925, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_BYTES_LIST_feature)", + "changeType": "UPSERT", + "aspectName": "mlFeatureProperties", + "aspect": { + "json": { + "customProperties": {}, + "dataType": "SEQUENCE", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741925, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_BYTES_feature)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741925, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_BYTES_feature)", + "changeType": "UPSERT", + "aspectName": "mlFeatureProperties", + "aspect": { + "json": { + "customProperties": {}, + "dataType": "BYTE", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741925, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_DOUBLE_LIST_feature)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741925, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_DOUBLE_LIST_feature)", + "changeType": "UPSERT", + "aspectName": "mlFeatureProperties", + "aspect": { + "json": { + "customProperties": {}, + "dataType": "SEQUENCE", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741925, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_DOUBLE_feature)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741925, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_DOUBLE_feature)", + "changeType": "UPSERT", + "aspectName": "mlFeatureProperties", + "aspect": { + "json": { + "customProperties": {}, + "dataType": "CONTINUOUS", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" + ] + } + }, + "systemMetadata": { + "lastObserved": 1758537741925, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_FLOAT_LIST_feature)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741926, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_FLOAT_LIST_feature)", + "changeType": "UPSERT", + "aspectName": "mlFeatureProperties", + "aspect": { + "json": { + "customProperties": {}, + "dataType": "SEQUENCE", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" ] } }, "systemMetadata": { - "lastObserved": 1758537741915, + "lastObserved": 1758537741926, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_FLOAT_feature)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false + } + }, + "systemMetadata": { + "lastObserved": 1758537741926, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataFlowSnapshot": { - "urn": "urn:li:dataFlow:(airflow,dag_abc,PROD)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ - { - "owner": "urn:li:corpuser:datahub", - "type": "DATAOWNER" - } - ], - "ownerTypes": {}, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:datahub" - } - } - }, - { - "com.linkedin.pegasus2avro.datajob.DataFlowInfo": { - "customProperties": {}, - "name": "Users", - "description": "Constructs the fct_users_deleted and fct_users_created tables" - } - } + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_FLOAT_feature)", + "changeType": "UPSERT", + "aspectName": "mlFeatureProperties", + "aspect": { + "json": { + "customProperties": {}, + "dataType": "CONTINUOUS", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" ] } }, "systemMetadata": { - "lastObserved": 1758537741915, + "lastObserved": 1758537741926, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.ChartSnapshot": { - "urn": "urn:li:chart:(looker,baz1)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.chart.ChartInfo": { - "customProperties": {}, - "title": "Baz Chart 1", - "description": "Baz Chart 1", - "lastModified": { - "created": { - "time": 1742778000000, - "actor": "urn:li:corpuser:jdoe" - }, - "lastModified": { - "time": 1742778000000, - "actor": "urn:li:corpuser:datahub" - } - }, - "inputs": [ - { - "string": "urn:li:dataset:(urn:li:dataPlatform:kafka,SampleKafkaDataset,PROD)" - } - ] - } - }, - { - "com.linkedin.pegasus2avro.common.GlobalTags": { - "tags": [ - { - "tag": "urn:li:tag:Legacy" - } - ] - } - } - ] + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_INT32_LIST_feature)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741916, + "lastObserved": 1758537741926, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.ChartSnapshot": { - "urn": "urn:li:chart:(looker,baz2)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.chart.ChartInfo": { - "customProperties": {}, - "title": "Baz Chart 2", - "description": "Baz Chart 2", - "lastModified": { - "created": { - "time": 1742778000000, - "actor": "urn:li:corpuser:jdoe" - }, - "lastModified": { - "time": 1742778000000, - "actor": "urn:li:corpuser:datahub" - } - }, - "inputs": [ - { - "string": "urn:li:dataset:(urn:li:dataPlatform:hdfs,SampleHdfsDataset,PROD)" - } - ] - } - } + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_INT32_LIST_feature)", + "changeType": "UPSERT", + "aspectName": "mlFeatureProperties", + "aspect": { + "json": { + "customProperties": {}, + "dataType": "SEQUENCE", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" ] } }, "systemMetadata": { - "lastObserved": 1758537741916, + "lastObserved": 1758537741926, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DashboardSnapshot": { - "urn": "urn:li:dashboard:(looker,baz)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ - { - "owner": "urn:li:corpGroup:bfoo", - "type": "DATAOWNER" - } - ], - "ownerTypes": {}, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - } - } - }, - { - "com.linkedin.pegasus2avro.dashboard.DashboardInfo": { - "customProperties": { - "prop1": "fakeprop", - "prop2": "pikachu" - }, - "title": "Baz Dashboard", - "description": "Baz Dashboard", - "charts": [ - "urn:li:chart:(looker,baz1)", - "urn:li:chart:(looker,baz2)" - ], - "datasets": [], - "dashboards": [], - "lastModified": { - "created": { - "time": 1742778000000, - "actor": "urn:li:corpuser:jdoe" - }, - "lastModified": { - "time": 1742778000000, - "actor": "urn:li:corpuser:datahub" - } - } - } - } - ] + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_INT32_feature)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741916, + "lastObserved": 1758537741926, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLModelSnapshot": { - "urn": "urn:li:mlModel:(urn:li:dataPlatform:science,scienceModel,PROD)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ - { - "owner": "urn:li:corpuser:jdoe", - "type": "DATAOWNER" - }, - { - "owner": "urn:li:corpuser:datahub", - "type": "DATAOWNER" - } - ], - "ownerTypes": {}, - "lastModified": { - "time": 1742778000000, - "actor": "urn:li:corpuser:jdoe" - } - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLModelProperties": { - "customProperties": {}, - "description": "A sample model for predicting some outcome.", - "type": "Naive Bayes classifier", - "tags": [ - "Sample" - ] - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.TrainingData": { - "trainingData": [ - { - "dataset": "urn:li:dataset:(urn:li:dataPlatform:hive,pageViewsHive,PROD)", - "motivation": "For science!", - "preProcessing": [ - "Aggregation" - ] - } - ] - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.EvaluationData": { - "evaluationData": [ - { - "dataset": "urn:li:dataset:(urn:li:dataPlatform:hive,pageViewsHive,PROD)" - } - ] - } - }, - { - "com.linkedin.pegasus2avro.common.InstitutionalMemory": { - "elements": [ - { - "url": "https://www.linkedin.com", - "description": "Sample doc", - "createStamp": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - } - } - ] - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.IntendedUse": { - "primaryUses": [ - "Sample Model", - "Primary Use" - ], - "primaryUsers": [ - "ENTERPRISE" - ], - "outOfScopeUses": [ - "Production Deployment" - ] - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.Metrics": { - "performanceMeasures": [ - "performanceMeasures" - ], - "decisionThreshold": [ - "decisionThreshold" - ] - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.EthicalConsiderations": { - "data": [ - "data" - ], - "humanLife": [ - "humanLife" - ], - "mitigations": [ - "mitigations" - ], - "risksAndHarms": [ - "risksAndHarms" - ], - "useCases": [ - "useCases" - ] - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.CaveatsAndRecommendations": { - "recommendations": "recommendations", - "idealDatasetCharacteristics": [ - "idealDatasetCharacteristics" - ] - } - }, - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.common.Cost": { - "costType": "ORG_COST_TYPE", - "cost": { - "costCode": "sampleCostCode", - "fieldDiscriminator": "costCode" - } - } - } + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_INT32_feature)", + "changeType": "UPSERT", + "aspectName": "mlFeatureProperties", + "aspect": { + "json": { + "customProperties": {}, + "dataType": "ORDINAL", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" ] } }, "systemMetadata": { - "lastObserved": 1758537741917, + "lastObserved": 1758537741926, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.TagSnapshot": { - "urn": "urn:li:tag:Legacy", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.tag.TagProperties": { - "name": "Legacy", - "description": "Indicates the dataset is no longer supported" - } - }, - { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ - { - "owner": "urn:li:corpuser:jdoe", - "type": "DATAOWNER" - } - ], - "ownerTypes": {}, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - } - } - } - ] + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_INT64_LIST_feature)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741918, + "lastObserved": 1758537741927, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.TagSnapshot": { - "urn": "urn:li:tag:NeedsDocumentation", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.tag.TagProperties": { - "name": "NeedsDocumentation", - "description": "Indicates the data element needs documentation" - } - }, - { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ - { - "owner": "urn:li:corpuser:jdoe", - "type": "DATAOWNER" - } - ], - "ownerTypes": {}, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - } - } - } + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_INT64_LIST_feature)", + "changeType": "UPSERT", + "aspectName": "mlFeatureProperties", + "aspect": { + "json": { + "customProperties": {}, + "dataType": "SEQUENCE", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" ] } }, "systemMetadata": { - "lastObserved": 1758537741918, + "lastObserved": 1758537741927, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:adlsGen1", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "adlsGen1", - "displayName": "Azure Data Lake (Gen 1)", - "type": "FILE_SYSTEM", - "datasetNameDelimiter": "/", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/adlslogo.png" - } - } - ] + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_INT64_feature)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741919, + "lastObserved": 1758537741927, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:adlsGen2", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "adlsGen2", - "displayName": "Azure Data Lake (Gen 2)", - "type": "FILE_SYSTEM", - "datasetNameDelimiter": "/", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/adlslogo.png" - } - } + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_INT64_feature)", + "changeType": "UPSERT", + "aspectName": "mlFeatureProperties", + "aspect": { + "json": { + "customProperties": {}, + "dataType": "ORDINAL", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" ] } }, "systemMetadata": { - "lastObserved": 1758537741919, + "lastObserved": 1758537741927, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:ambry", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "ambry", - "displayName": "Ambry", - "type": "OBJECT_STORE", - "datasetNameDelimiter": "." - } - } - ] + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_STRING_LIST_feature)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741919, + "lastObserved": 1758537741927, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:couchbase", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "couchbase", - "displayName": "Couchbase", - "type": "KEY_VALUE_STORE", - "datasetNameDelimiter": ".", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/couchbaselogo.png" - } - } + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_STRING_LIST_feature)", + "changeType": "UPSERT", + "aspectName": "mlFeatureProperties", + "aspect": { + "json": { + "customProperties": {}, + "dataType": "SEQUENCE", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" ] } }, "systemMetadata": { - "lastObserved": 1758537741919, + "lastObserved": 1758537741927, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:external", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "external", - "displayName": "External Source", - "type": "OTHERS", - "datasetNameDelimiter": "." - } - } - ] + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_STRING_feature)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741919, + "lastObserved": 1758537741927, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:hdfs", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "hdfs", - "displayName": "HDFS", - "type": "FILE_SYSTEM", - "datasetNameDelimiter": "/", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/hadooplogo.png" - } - } + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_STRING_feature)", + "changeType": "UPSERT", + "aspectName": "mlFeatureProperties", + "aspect": { + "json": { + "customProperties": {}, + "dataType": "TEXT", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" ] } }, "systemMetadata": { - "lastObserved": 1758537741920, + "lastObserved": 1758537741927, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:hive", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "hive", - "displayName": "Hive", - "type": "FILE_SYSTEM", - "datasetNameDelimiter": ".", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/hivelogo.png" - } - } - ] + "entityType": "mlFeatureTable", + "entityUrn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,test_feature_table_all_feature_dtypes)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741920, + "lastObserved": 1758537741928, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:s3", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "s3", - "displayName": "AWS S3", - "type": "FILE_SYSTEM", - "datasetNameDelimiter": "/", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/s3.png" - } - } + "entityType": "mlFeatureTable", + "entityUrn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,test_feature_table_all_feature_dtypes)", + "changeType": "UPSERT", + "aspectName": "browsePaths", + "aspect": { + "json": { + "paths": [ + "/feast/test_feature_table_all_feature_dtypes" ] } }, "systemMetadata": { - "lastObserved": 1758537741920, + "lastObserved": 1758537741928, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:kafka", - "aspects": [ + "entityType": "mlFeatureTable", + "entityUrn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,test_feature_table_all_feature_dtypes)", + "changeType": "UPSERT", + "aspectName": "browsePathsV2", + "aspect": { + "json": { + "path": [ { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "kafka", - "displayName": "Kafka", - "type": "MESSAGE_BROKER", - "datasetNameDelimiter": ".", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/kafkalogo.png" - } + "id": "feast" + }, + { + "id": "test_feature_table_all_feature_dtypes" } ] } }, "systemMetadata": { - "lastObserved": 1758537741920, + "lastObserved": 1758537741928, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:kusto", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "kusto", - "displayName": "Kusto", - "type": "OLAP_DATASTORE", - "datasetNameDelimiter": ".", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/kustologo.png" - } - } + "entityType": "mlFeatureTable", + "entityUrn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,test_feature_table_all_feature_dtypes)", + "changeType": "UPSERT", + "aspectName": "mlFeatureTableProperties", + "aspect": { + "json": { + "customProperties": {}, + "mlFeatures": [ + "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_BOOL_LIST_feature)", + "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_BOOL_feature)", + "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_BYTES_LIST_feature)", + "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_BYTES_feature)", + "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_DOUBLE_LIST_feature)", + "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_DOUBLE_feature)", + "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_FLOAT_LIST_feature)", + "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_FLOAT_feature)", + "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_INT32_LIST_feature)", + "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_INT32_feature)", + "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_INT64_LIST_feature)", + "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_INT64_feature)", + "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_STRING_LIST_feature)", + "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_STRING_feature)" + ], + "mlPrimaryKeys": [ + "urn:li:mlPrimaryKey:(test_feature_table_all_feature_dtypes,dummy_entity_1)", + "urn:li:mlPrimaryKey:(test_feature_table_all_feature_dtypes,dummy_entity_2)" ] } }, "systemMetadata": { - "lastObserved": 1758537741920, + "lastObserved": 1758537741928, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:mongodb", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "mongodb", - "displayName": "MongoDB", - "type": "KEY_VALUE_STORE", - "datasetNameDelimiter": ".", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/mongodblogo.png" - } - } - ] + "entityType": "mlPrimaryKey", + "entityUrn": "urn:li:mlPrimaryKey:(test_feature_table_no_labels,dummy_entity_2)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741921, + "lastObserved": 1758537741928, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:mysql", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "mysql", - "displayName": "MySQL", - "type": "RELATIONAL_DB", - "datasetNameDelimiter": ".", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/mysqllogo.png" - } - } + "entityType": "mlPrimaryKey", + "entityUrn": "urn:li:mlPrimaryKey:(test_feature_table_no_labels,dummy_entity_2)", + "changeType": "UPSERT", + "aspectName": "mlPrimaryKeyProperties", + "aspect": { + "json": { + "customProperties": {}, + "description": "Dummy entity 2", + "dataType": "ORDINAL", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" ] } }, "systemMetadata": { - "lastObserved": 1758537741921, + "lastObserved": 1758537741928, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:oracle", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "oracle", - "displayName": "Oracle", - "type": "RELATIONAL_DB", - "datasetNameDelimiter": ".", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/oraclelogo.png" - } - } - ] + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_no_labels,test_BYTES_feature)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741921, + "lastObserved": 1758537741928, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:pinot", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "pinot", - "displayName": "Pinot", - "type": "OLAP_DATASTORE", - "datasetNameDelimiter": ".", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/pinotlogo.png" - } - } + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_no_labels,test_BYTES_feature)", + "changeType": "UPSERT", + "aspectName": "mlFeatureProperties", + "aspect": { + "json": { + "customProperties": {}, + "dataType": "BYTE", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" ] } }, "systemMetadata": { - "lastObserved": 1758537741921, + "lastObserved": 1758537741928, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:postgres", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "postgres", - "displayName": "PostgreSQL", - "type": "RELATIONAL_DB", - "datasetNameDelimiter": ".", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/postgreslogo.png" - } - } - ] + "entityType": "mlFeatureTable", + "entityUrn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,test_feature_table_no_labels)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741921, + "lastObserved": 1758537741928, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:presto", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "presto", - "displayName": "Presto", - "type": "QUERY_ENGINE", - "datasetNameDelimiter": ".", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/prestologo.png" - } - } + "entityType": "mlFeatureTable", + "entityUrn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,test_feature_table_no_labels)", + "changeType": "UPSERT", + "aspectName": "browsePaths", + "aspect": { + "json": { + "paths": [ + "/feast/test_feature_table_no_labels" ] } }, "systemMetadata": { - "lastObserved": 1758537741921, + "lastObserved": 1758537741928, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:teradata", - "aspects": [ + "entityType": "mlFeatureTable", + "entityUrn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,test_feature_table_no_labels)", + "changeType": "UPSERT", + "aspectName": "browsePathsV2", + "aspect": { + "json": { + "path": [ { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "teradata", - "displayName": "Teradata", - "type": "RELATIONAL_DB", - "datasetNameDelimiter": ".", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/teradatalogo.png" - } + "id": "feast" + }, + { + "id": "test_feature_table_no_labels" } ] } }, "systemMetadata": { - "lastObserved": 1758537741922, + "lastObserved": 1758537741928, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:voldemort", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "voldemort", - "displayName": "Voldemort", - "type": "KEY_VALUE_STORE", - "datasetNameDelimiter": "." - } - } + "entityType": "mlFeatureTable", + "entityUrn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,test_feature_table_no_labels)", + "changeType": "UPSERT", + "aspectName": "mlFeatureTableProperties", + "aspect": { + "json": { + "customProperties": {}, + "mlFeatures": [ + "urn:li:mlFeature:(test_feature_table_no_labels,test_BYTES_feature)" + ], + "mlPrimaryKeys": [ + "urn:li:mlPrimaryKey:(test_feature_table_no_labels,dummy_entity_2)" ] } }, "systemMetadata": { - "lastObserved": 1758537741922, + "lastObserved": 1758537741928, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:snowflake", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "snowflake", - "displayName": "Snowflake", - "type": "RELATIONAL_DB", - "datasetNameDelimiter": ".", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/snowflakelogo.png" - } - } - ] + "entityType": "mlPrimaryKey", + "entityUrn": "urn:li:mlPrimaryKey:(test_feature_table_single_feature,dummy_entity_1)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741922, + "lastObserved": 1758537741929, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:redshift", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "redshift", - "displayName": "Redshift", - "type": "RELATIONAL_DB", - "datasetNameDelimiter": ".", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/redshiftlogo.png" - } - } + "entityType": "mlPrimaryKey", + "entityUrn": "urn:li:mlPrimaryKey:(test_feature_table_single_feature,dummy_entity_1)", + "changeType": "UPSERT", + "aspectName": "mlPrimaryKeyProperties", + "aspect": { + "json": { + "customProperties": {}, + "description": "Dummy entity 1", + "dataType": "TEXT", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" ] } }, "systemMetadata": { - "lastObserved": 1758537741922, + "lastObserved": 1758537741929, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:mssql", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "mssql", - "displayName": "SQL Server", - "type": "RELATIONAL_DB", - "datasetNameDelimiter": ".", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/mssqllogo.png" - } - } - ] + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_single_feature,test_BYTES_feature)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741922, + "lastObserved": 1758537741929, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:bigquery", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "bigquery", - "displayName": "BigQuery", - "type": "RELATIONAL_DB", - "datasetNameDelimiter": ".", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/bigquerylogo.png" - } - } + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(test_feature_table_single_feature,test_BYTES_feature)", + "changeType": "UPSERT", + "aspectName": "mlFeatureProperties", + "aspect": { + "json": { + "customProperties": {}, + "dataType": "BYTE", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" ] } }, "systemMetadata": { - "lastObserved": 1758537741923, + "lastObserved": 1758537741929, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:druid", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "druid", - "displayName": "Druid", - "type": "OLAP_DATASTORE", - "datasetNameDelimiter": ".", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/druidlogo.png" - } - } - ] + "entityType": "mlFeatureTable", + "entityUrn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,test_feature_table_single_feature)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741923, + "lastObserved": 1758537741929, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:looker", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "looker", - "displayName": "Looker", - "type": "OTHERS", - "datasetNameDelimiter": ".", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/lookerlogo.png" - } - } + "entityType": "mlFeatureTable", + "entityUrn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,test_feature_table_single_feature)", + "changeType": "UPSERT", + "aspectName": "browsePaths", + "aspect": { + "json": { + "paths": [ + "/feast/test_feature_table_single_feature" ] } }, "systemMetadata": { - "lastObserved": 1758537741923, + "lastObserved": 1758537741929, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:feast", - "aspects": [ + "entityType": "mlFeatureTable", + "entityUrn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,test_feature_table_single_feature)", + "changeType": "UPSERT", + "aspectName": "browsePathsV2", + "aspect": { + "json": { + "path": [ { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "feast", - "displayName": "Feast", - "type": "OTHERS", - "datasetNameDelimiter": ".", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/feastlogo.png" - } + "id": "feast" + }, + { + "id": "test_feature_table_single_feature" } ] } }, "systemMetadata": { - "lastObserved": 1758537741923, + "lastObserved": 1758537741929, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:sagemaker", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "sagemaker", - "displayName": "SageMaker", - "type": "OTHERS", - "datasetNameDelimiter": ".", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/sagemakerlogo.png" - } - } + "entityType": "mlFeatureTable", + "entityUrn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,test_feature_table_single_feature)", + "changeType": "UPSERT", + "aspectName": "mlFeatureTableProperties", + "aspect": { + "json": { + "customProperties": {}, + "mlFeatures": [ + "urn:li:mlFeature:(test_feature_table_single_feature,test_BYTES_feature)" + ], + "mlPrimaryKeys": [ + "urn:li:mlPrimaryKey:(test_feature_table_single_feature,dummy_entity_1)" ] } }, "systemMetadata": { - "lastObserved": 1758537741923, + "lastObserved": 1758537741929, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:glue", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "name": "glue", - "displayName": "Glue", - "type": "OTHERS", - "datasetNameDelimiter": ".", - "logoUrl": "https://raw.githubusercontent.com/datahub-project/datahub/master/datahub-web-react/src/images/gluelogo.png" - } - } - ] + "entityType": "mlPrimaryKey", + "entityUrn": "urn:li:mlPrimaryKey:(user_features,user_name)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741923, + "lastObserved": 1758537741929, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLPrimaryKeySnapshot": { - "urn": "urn:li:mlPrimaryKey:(test_feature_table_all_feature_dtypes,dummy_entity_1)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLPrimaryKeyProperties": { - "customProperties": {}, - "description": "Dummy entity 1", - "dataType": "TEXT", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" - ] - } - } + "entityType": "mlPrimaryKey", + "entityUrn": "urn:li:mlPrimaryKey:(user_features,user_name)", + "changeType": "UPSERT", + "aspectName": "mlPrimaryKeyProperties", + "aspect": { + "json": { + "customProperties": {}, + "description": "User's user_name", + "dataType": "TEXT", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)" ] } }, "systemMetadata": { - "lastObserved": 1758537741924, + "lastObserved": 1758537741929, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLPrimaryKeySnapshot": { - "urn": "urn:li:mlPrimaryKey:(test_feature_table_all_feature_dtypes,dummy_entity_2)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLPrimaryKeyProperties": { - "customProperties": {}, - "description": "Dummy entity 2", - "dataType": "ORDINAL", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" - ] - } - } - ] + "entityType": "mlPrimaryKey", + "entityUrn": "urn:li:mlPrimaryKey:(user_features,user_id)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741924, + "lastObserved": 1758537741929, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureSnapshot": { - "urn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_BOOL_LIST_feature)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureProperties": { - "customProperties": {}, - "dataType": "SEQUENCE", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" - ] - } - } + "entityType": "mlPrimaryKey", + "entityUrn": "urn:li:mlPrimaryKey:(user_features,user_id)", + "changeType": "UPSERT", + "aspectName": "mlPrimaryKeyProperties", + "aspect": { + "json": { + "customProperties": {}, + "description": "User's internal ID", + "dataType": "ORDINAL", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)" ] } }, "systemMetadata": { - "lastObserved": 1758537741924, + "lastObserved": 1758537741929, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureSnapshot": { - "urn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_BOOL_feature)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureProperties": { - "customProperties": {}, - "dataType": "BINARY", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" - ] - } - } - ] + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(user_features,regions)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741924, + "lastObserved": 1758537741930, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureSnapshot": { - "urn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_BYTES_LIST_feature)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureProperties": { - "customProperties": {}, - "dataType": "SEQUENCE", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" - ] - } - } + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(user_features,regions)", + "changeType": "UPSERT", + "aspectName": "mlFeatureProperties", + "aspect": { + "json": { + "customProperties": {}, + "dataType": "SEQUENCE", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)" ] } }, "systemMetadata": { - "lastObserved": 1758537741925, + "lastObserved": 1758537741930, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureSnapshot": { - "urn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_BYTES_feature)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureProperties": { - "customProperties": {}, - "dataType": "BYTE", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" - ] - } - } - ] + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(user_features,is_premium_user)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741925, + "lastObserved": 1758537741930, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, -{ - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureSnapshot": { - "urn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_DOUBLE_LIST_feature)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureProperties": { - "customProperties": {}, - "dataType": "SEQUENCE", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" - ] - } - } +{ + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(user_features,is_premium_user)", + "changeType": "UPSERT", + "aspectName": "mlFeatureProperties", + "aspect": { + "json": { + "customProperties": {}, + "dataType": "BINARY", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)" ] } }, "systemMetadata": { - "lastObserved": 1758537741925, + "lastObserved": 1758537741930, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureSnapshot": { - "urn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_DOUBLE_feature)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureProperties": { - "customProperties": {}, - "dataType": "CONTINUOUS", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" - ] - } - } - ] + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(user_features,number_of_visits)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741925, + "lastObserved": 1758537741930, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureSnapshot": { - "urn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_FLOAT_LIST_feature)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureProperties": { - "customProperties": {}, - "dataType": "SEQUENCE", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" - ] - } - } + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(user_features,number_of_visits)", + "changeType": "UPSERT", + "aspectName": "mlFeatureProperties", + "aspect": { + "json": { + "customProperties": {}, + "dataType": "ORDINAL", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)" ] } }, "systemMetadata": { - "lastObserved": 1758537741926, + "lastObserved": 1758537741930, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureSnapshot": { - "urn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_FLOAT_feature)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureProperties": { - "customProperties": {}, - "dataType": "CONTINUOUS", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" - ] - } - } - ] + "entityType": "mlFeatureTable", + "entityUrn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,user_features)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741926, + "lastObserved": 1758537741930, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureSnapshot": { - "urn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_INT32_LIST_feature)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureProperties": { - "customProperties": {}, - "dataType": "SEQUENCE", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" - ] - } - } + "entityType": "mlFeatureTable", + "entityUrn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,user_features)", + "changeType": "UPSERT", + "aspectName": "browsePaths", + "aspect": { + "json": { + "paths": [ + "/feast/user_features" ] } }, "systemMetadata": { - "lastObserved": 1758537741926, + "lastObserved": 1758537741930, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureSnapshot": { - "urn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_INT32_feature)", - "aspects": [ + "entityType": "mlFeatureTable", + "entityUrn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,user_features)", + "changeType": "UPSERT", + "aspectName": "browsePathsV2", + "aspect": { + "json": { + "path": [ { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } + "id": "feast" }, { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureProperties": { - "customProperties": {}, - "dataType": "ORDINAL", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" - ] - } + "id": "user_features" } ] } }, "systemMetadata": { - "lastObserved": 1758537741926, + "lastObserved": 1758537741930, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureSnapshot": { - "urn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_INT64_LIST_feature)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureProperties": { - "customProperties": {}, - "dataType": "SEQUENCE", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" - ] - } - } + "entityType": "mlFeatureTable", + "entityUrn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,user_features)", + "changeType": "UPSERT", + "aspectName": "mlFeatureTableProperties", + "aspect": { + "json": { + "customProperties": {}, + "mlFeatures": [ + "urn:li:mlFeature:(user_features,regions)", + "urn:li:mlFeature:(user_features,is_premium_user)", + "urn:li:mlFeature:(user_features,number_of_visits)" + ], + "mlPrimaryKeys": [ + "urn:li:mlPrimaryKey:(user_features,user_name)", + "urn:li:mlPrimaryKey:(user_features,user_id)" ] } }, "systemMetadata": { - "lastObserved": 1758537741927, + "lastObserved": 1758537741930, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureSnapshot": { - "urn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_INT64_feature)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureProperties": { - "customProperties": {}, - "dataType": "ORDINAL", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" - ] - } - } - ] + "entityType": "mlPrimaryKey", + "entityUrn": "urn:li:mlPrimaryKey:(user_analytics,user_name)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741927, + "lastObserved": 1758537741931, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureSnapshot": { - "urn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_STRING_LIST_feature)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureProperties": { - "customProperties": {}, - "dataType": "SEQUENCE", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" - ] - } - } + "entityType": "mlPrimaryKey", + "entityUrn": "urn:li:mlPrimaryKey:(user_analytics,user_name)", + "changeType": "UPSERT", + "aspectName": "mlPrimaryKeyProperties", + "aspect": { + "json": { + "customProperties": {}, + "description": "User's username", + "dataType": "TEXT", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)" ] } }, "systemMetadata": { - "lastObserved": 1758537741927, + "lastObserved": 1758537741931, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureSnapshot": { - "urn": "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_STRING_feature)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureProperties": { - "customProperties": {}, - "dataType": "TEXT", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" - ] - } - } - ] + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(user_analytics,date_joined)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741927, + "lastObserved": 1758537741931, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureTableSnapshot": { - "urn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,test_feature_table_all_feature_dtypes)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.common.BrowsePaths": { - "paths": [ - "/feast/test_feature_table_all_feature_dtypes" - ] - } - }, - { - "com.linkedin.pegasus2avro.common.BrowsePathsV2": { - "path": [ - { - "id": "feast" - }, - { - "id": "test_feature_table_all_feature_dtypes" - } - ] - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureTableProperties": { - "customProperties": {}, - "mlFeatures": [ - "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_BOOL_LIST_feature)", - "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_BOOL_feature)", - "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_BYTES_LIST_feature)", - "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_BYTES_feature)", - "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_DOUBLE_LIST_feature)", - "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_DOUBLE_feature)", - "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_FLOAT_LIST_feature)", - "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_FLOAT_feature)", - "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_INT32_LIST_feature)", - "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_INT32_feature)", - "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_INT64_LIST_feature)", - "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_INT64_feature)", - "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_STRING_LIST_feature)", - "urn:li:mlFeature:(test_feature_table_all_feature_dtypes,test_STRING_feature)" - ], - "mlPrimaryKeys": [ - "urn:li:mlPrimaryKey:(test_feature_table_all_feature_dtypes,dummy_entity_1)", - "urn:li:mlPrimaryKey:(test_feature_table_all_feature_dtypes,dummy_entity_2)" - ] - } - } + "entityType": "mlFeature", + "entityUrn": "urn:li:mlFeature:(user_analytics,date_joined)", + "changeType": "UPSERT", + "aspectName": "mlFeatureProperties", + "aspect": { + "json": { + "customProperties": {}, + "dataType": "BYTE", + "sources": [ + "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)" ] } }, "systemMetadata": { - "lastObserved": 1758537741928, + "lastObserved": 1758537741931, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLPrimaryKeySnapshot": { - "urn": "urn:li:mlPrimaryKey:(test_feature_table_no_labels,dummy_entity_2)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLPrimaryKeyProperties": { - "customProperties": {}, - "description": "Dummy entity 2", - "dataType": "ORDINAL", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" - ] - } - } - ] + "entityType": "mlFeatureTable", + "entityUrn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,user_analytics)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741928, + "lastObserved": 1758537741931, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureSnapshot": { - "urn": "urn:li:mlFeature:(test_feature_table_no_labels,test_BYTES_feature)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureProperties": { - "customProperties": {}, - "dataType": "BYTE", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" - ] - } - } + "entityType": "mlFeatureTable", + "entityUrn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,user_analytics)", + "changeType": "UPSERT", + "aspectName": "browsePaths", + "aspect": { + "json": { + "paths": [ + "/feast/user_analytics" ] } }, "systemMetadata": { - "lastObserved": 1758537741928, + "lastObserved": 1758537741931, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureTableSnapshot": { - "urn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,test_feature_table_no_labels)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.common.BrowsePaths": { - "paths": [ - "/feast/test_feature_table_no_labels" - ] - } - }, + "entityType": "mlFeatureTable", + "entityUrn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,user_analytics)", + "changeType": "UPSERT", + "aspectName": "browsePathsV2", + "aspect": { + "json": { + "path": [ { - "com.linkedin.pegasus2avro.common.BrowsePathsV2": { - "path": [ - { - "id": "feast" - }, - { - "id": "test_feature_table_no_labels" - } - ] - } + "id": "feast" }, { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureTableProperties": { - "customProperties": {}, - "mlFeatures": [ - "urn:li:mlFeature:(test_feature_table_no_labels,test_BYTES_feature)" - ], - "mlPrimaryKeys": [ - "urn:li:mlPrimaryKey:(test_feature_table_no_labels,dummy_entity_2)" - ] - } + "id": "user_analytics" } ] } }, "systemMetadata": { - "lastObserved": 1758537741928, + "lastObserved": 1758537741931, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLPrimaryKeySnapshot": { - "urn": "urn:li:mlPrimaryKey:(test_feature_table_single_feature,dummy_entity_1)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLPrimaryKeyProperties": { - "customProperties": {}, - "description": "Dummy entity 1", - "dataType": "TEXT", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" - ] - } - } + "entityType": "mlFeatureTable", + "entityUrn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,user_analytics)", + "changeType": "UPSERT", + "aspectName": "mlFeatureTableProperties", + "aspect": { + "json": { + "customProperties": {}, + "mlFeatures": [ + "urn:li:mlFeature:(user_analytics,date_joined)" + ], + "mlPrimaryKeys": [ + "urn:li:mlPrimaryKey:(user_analytics,user_name)" ] } }, "systemMetadata": { - "lastObserved": 1758537741929, + "lastObserved": 1758537741931, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureSnapshot": { - "urn": "urn:li:mlFeature:(test_feature_table_single_feature,test_BYTES_feature)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureProperties": { - "customProperties": {}, - "dataType": "BYTE", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:file,feast.*,PROD)" - ] - } - } - ] + "entityType": "glossaryTerm", + "entityUrn": "urn:li:glossaryTerm:CustomerAccount", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741929, + "lastObserved": 1758537741931, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureTableSnapshot": { - "urn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,test_feature_table_single_feature)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.common.BrowsePaths": { - "paths": [ - "/feast/test_feature_table_single_feature" - ] - } - }, - { - "com.linkedin.pegasus2avro.common.BrowsePathsV2": { - "path": [ - { - "id": "feast" - }, - { - "id": "test_feature_table_single_feature" - } - ] - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureTableProperties": { - "customProperties": {}, - "mlFeatures": [ - "urn:li:mlFeature:(test_feature_table_single_feature,test_BYTES_feature)" - ], - "mlPrimaryKeys": [ - "urn:li:mlPrimaryKey:(test_feature_table_single_feature,dummy_entity_1)" - ] - } - } - ] + "entityType": "glossaryTerm", + "entityUrn": "urn:li:glossaryTerm:CustomerAccount", + "changeType": "UPSERT", + "aspectName": "glossaryTermInfo", + "aspect": { + "json": { + "customProperties": { + "FQDN": "CustomerAccount" + }, + "definition": "account that represents an identified, named collection of balances and cumulative totals used to summarize customer transaction-related activity over a designated period of time", + "parentNode": "urn:li:glossaryNode:ClientsAndAccounts", + "termSource": "EXTERNAL", + "sourceRef": "FIBO", + "sourceUrl": "https://spec.edmcouncil.org/fibo/ontology/FBC/ProductsAndServices/ClientsAndAccounts/CustomerAccount" } }, "systemMetadata": { - "lastObserved": 1758537741929, + "lastObserved": 1758537741931, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLPrimaryKeySnapshot": { - "urn": "urn:li:mlPrimaryKey:(user_features,user_name)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, + "entityType": "glossaryTerm", + "entityUrn": "urn:li:glossaryTerm:CustomerAccount", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ { - "com.linkedin.pegasus2avro.ml.metadata.MLPrimaryKeyProperties": { - "customProperties": {}, - "description": "User's user_name", - "dataType": "TEXT", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)" - ] - } + "owner": "urn:li:corpuser:jdoe", + "type": "DATAOWNER" } - ] + ], + "ownerTypes": {}, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + } + } + }, + "systemMetadata": { + "lastObserved": 1758537741931, + "runId": "demo-data-2025_09_22-16_12_20-modc1r", + "lastRunId": "no-run-id-provided" + } +}, +{ + "entityType": "glossaryTerm", + "entityUrn": "urn:li:glossaryTerm:SavingAccount", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741929, + "lastObserved": 1758537741932, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLPrimaryKeySnapshot": { - "urn": "urn:li:mlPrimaryKey:(user_features,user_id)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLPrimaryKeyProperties": { - "customProperties": {}, - "description": "User's internal ID", - "dataType": "ORDINAL", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)" - ] - } - } - ] + "entityType": "glossaryTerm", + "entityUrn": "urn:li:glossaryTerm:SavingAccount", + "changeType": "UPSERT", + "aspectName": "glossaryTermInfo", + "aspect": { + "json": { + "customProperties": { + "FQDN": "SavingAccount" + }, + "definition": "a product provided to consumers and businesses by a bank or similar depository institution such as a checking account, savings account, certificate of deposit, debit or pre-paid card, or credit card", + "parentNode": "urn:li:glossaryNode:ClientsAndAccounts", + "termSource": "EXTERNAL", + "sourceRef": "FIBO", + "sourceUrl": "https://spec.edmcouncil.org/fibo/ontology/FBC/FunctionalEntities/FinancialServicesEntities/BankingProduct" } }, "systemMetadata": { - "lastObserved": 1758537741929, + "lastObserved": 1758537741932, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureSnapshot": { - "urn": "urn:li:mlFeature:(user_features,regions)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, + "entityType": "glossaryTerm", + "entityUrn": "urn:li:glossaryTerm:SavingAccount", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureProperties": { - "customProperties": {}, - "dataType": "SEQUENCE", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)" - ] - } + "owner": "urn:li:corpuser:jdoe", + "type": "DATAOWNER" } - ] + ], + "ownerTypes": {}, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + } } }, "systemMetadata": { - "lastObserved": 1758537741930, + "lastObserved": 1758537741932, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureSnapshot": { - "urn": "urn:li:mlFeature:(user_features,is_premium_user)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureProperties": { - "customProperties": {}, - "dataType": "BINARY", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)" - ] - } - } - ] + "entityType": "glossaryTerm", + "entityUrn": "urn:li:glossaryTerm:AccountBalance", + "changeType": "UPSERT", + "aspectName": "glossaryTermInfo", + "aspect": { + "json": { + "customProperties": { + "FQDN": "AccountBalance" + }, + "definition": "amount of money available or owed", + "parentNode": "urn:li:glossaryNode:ClientsAndAccounts", + "termSource": "EXTERNAL", + "sourceRef": "FIBO", + "sourceUrl": "https://spec.edmcouncil.org/fibo/ontology/FBC/ProductsAndServices/ClientsAndAccounts/Balance" } }, "systemMetadata": { - "lastObserved": 1758537741930, + "lastObserved": 1758537741932, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureSnapshot": { - "urn": "urn:li:mlFeature:(user_features,number_of_visits)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, + "entityType": "glossaryTerm", + "entityUrn": "urn:li:glossaryTerm:AccountBalance", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureProperties": { - "customProperties": {}, - "dataType": "ORDINAL", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)" - ] - } + "owner": "urn:li:corpuser:jdoe", + "type": "DATAOWNER" } - ] + ], + "ownerTypes": {}, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + } } }, "systemMetadata": { - "lastObserved": 1758537741930, + "lastObserved": 1758537741932, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureTableSnapshot": { - "urn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,user_features)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.common.BrowsePaths": { - "paths": [ - "/feast/user_features" - ] - } - }, - { - "com.linkedin.pegasus2avro.common.BrowsePathsV2": { - "path": [ - { - "id": "feast" - }, - { - "id": "user_features" - } - ] - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureTableProperties": { - "customProperties": {}, - "mlFeatures": [ - "urn:li:mlFeature:(user_features,regions)", - "urn:li:mlFeature:(user_features,is_premium_user)", - "urn:li:mlFeature:(user_features,number_of_visits)" - ], - "mlPrimaryKeys": [ - "urn:li:mlPrimaryKey:(user_features,user_name)", - "urn:li:mlPrimaryKey:(user_features,user_id)" - ] - } - } - ] + "entityType": "glossaryTerm", + "entityUrn": "urn:li:glossaryTerm:AccountBalance", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741930, + "lastObserved": 1758537741932, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLPrimaryKeySnapshot": { - "urn": "urn:li:mlPrimaryKey:(user_analytics,user_name)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLPrimaryKeyProperties": { - "customProperties": {}, - "description": "User's username", - "dataType": "TEXT", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)" - ] - } - } - ] + "entityType": "glossaryNode", + "entityUrn": "urn:li:glossaryNode:ClientsAndAccounts", + "changeType": "UPSERT", + "aspectName": "glossaryNodeInfo", + "aspect": { + "json": { + "customProperties": {}, + "definition": "Provides basic concepts such as account, account holder, account provider, relationship manager that are commonly used by financial services providers to describe customers and to determine counterparty identities" } }, "systemMetadata": { - "lastObserved": 1758537741931, + "lastObserved": 1758537741932, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureSnapshot": { - "urn": "urn:li:mlFeature:(user_analytics,date_joined)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, + "entityType": "glossaryNode", + "entityUrn": "urn:li:glossaryNode:ClientsAndAccounts", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureProperties": { - "customProperties": {}, - "dataType": "BYTE", - "sources": [ - "urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)" - ] - } + "owner": "urn:li:corpuser:jdoe", + "type": "DATAOWNER" } - ] + ], + "ownerTypes": {}, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + } } }, "systemMetadata": { - "lastObserved": 1758537741931, + "lastObserved": 1758537741932, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.MLFeatureTableSnapshot": { - "urn": "urn:li:mlFeatureTable:(urn:li:dataPlatform:feast,user_analytics)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.common.BrowsePaths": { - "paths": [ - "/feast/user_analytics" - ] - } - }, - { - "com.linkedin.pegasus2avro.common.BrowsePathsV2": { - "path": [ - { - "id": "feast" - }, - { - "id": "user_analytics" - } - ] - } - }, - { - "com.linkedin.pegasus2avro.ml.metadata.MLFeatureTableProperties": { - "customProperties": {}, - "mlFeatures": [ - "urn:li:mlFeature:(user_analytics,date_joined)" - ], - "mlPrimaryKeys": [ - "urn:li:mlPrimaryKey:(user_analytics,user_name)" - ] - } - } - ] + "entityType": "glossaryNode", + "entityUrn": "urn:li:glossaryNode:ClientsAndAccounts", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741931, + "lastObserved": 1758537741932, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.GlossaryTermSnapshot": { - "urn": "urn:li:glossaryTerm:CustomerAccount", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.glossary.GlossaryTermInfo": { - "customProperties": { - "FQDN": "CustomerAccount" - }, - "definition": "account that represents an identified, named collection of balances and cumulative totals used to summarize customer transaction-related activity over a designated period of time", - "parentNode": "urn:li:glossaryNode:ClientsAndAccounts", - "termSource": "EXTERNAL", - "sourceRef": "FIBO", - "sourceUrl": "https://spec.edmcouncil.org/fibo/ontology/FBC/ProductsAndServices/ClientsAndAccounts/CustomerAccount" - } - }, - { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ - { - "owner": "urn:li:corpuser:jdoe", - "type": "DATAOWNER" - } - ], - "ownerTypes": {}, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - } - } - } - ] + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:s3,project/root/events/logging_events_bckp,PROD)", + "changeType": "UPSERT", + "aspectName": "status", + "aspect": { + "json": { + "removed": false } }, "systemMetadata": { - "lastObserved": 1758537741931, + "lastObserved": 1758537741933, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.GlossaryTermSnapshot": { - "urn": "urn:li:glossaryTerm:SavingAccount", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, - { - "com.linkedin.pegasus2avro.glossary.GlossaryTermInfo": { - "customProperties": { - "FQDN": "SavingAccount" - }, - "definition": "a product provided to consumers and businesses by a bank or similar depository institution such as a checking account, savings account, certificate of deposit, debit or pre-paid card, or credit card", - "parentNode": "urn:li:glossaryNode:ClientsAndAccounts", - "termSource": "EXTERNAL", - "sourceRef": "FIBO", - "sourceUrl": "https://spec.edmcouncil.org/fibo/ontology/FBC/FunctionalEntities/FinancialServicesEntities/BankingProduct" - } - }, - { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ - { - "owner": "urn:li:corpuser:jdoe", - "type": "DATAOWNER" - } - ], - "ownerTypes": {}, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - } - } - } - ] + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:s3,project/root/events/logging_events_bckp,PROD)", + "changeType": "UPSERT", + "aspectName": "datasetProperties", + "aspect": { + "json": { + "customProperties": { + "encoding": "utf-8" + }, + "description": "s3 backup of logging events", + "tags": [] } }, "systemMetadata": { - "lastObserved": 1758537741932, + "lastObserved": 1758537741933, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.GlossaryTermSnapshot": { - "urn": "urn:li:glossaryTerm:AccountBalance", - "aspects": [ - { - "com.linkedin.pegasus2avro.glossary.GlossaryTermInfo": { - "customProperties": { - "FQDN": "AccountBalance" - }, - "definition": "amount of money available or owed", - "parentNode": "urn:li:glossaryNode:ClientsAndAccounts", - "termSource": "EXTERNAL", - "sourceRef": "FIBO", - "sourceUrl": "https://spec.edmcouncil.org/fibo/ontology/FBC/ProductsAndServices/ClientsAndAccounts/Balance" - } - }, + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:s3,project/root/events/logging_events_bckp,PROD)", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ - { - "owner": "urn:li:corpuser:jdoe", - "type": "DATAOWNER" - } - ], - "ownerTypes": {}, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - } - } + "owner": "urn:li:corpuser:jdoe", + "type": "DATAOWNER" }, { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } + "owner": "urn:li:corpuser:datahub", + "type": "DATAOWNER" } - ] + ], + "ownerTypes": {}, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + } } }, "systemMetadata": { - "lastObserved": 1758537741932, + "lastObserved": 1758537741933, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.GlossaryNodeSnapshot": { - "urn": "urn:li:glossaryNode:ClientsAndAccounts", - "aspects": [ - { - "com.linkedin.pegasus2avro.glossary.GlossaryNodeInfo": { - "customProperties": {}, - "definition": "Provides basic concepts such as account, account holder, account provider, relationship manager that are commonly used by financial services providers to describe customers and to determine counterparty identities" - } - }, - { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ - { - "owner": "urn:li:corpuser:jdoe", - "type": "DATAOWNER" - } - ], - "ownerTypes": {}, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - } - } - }, - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:s3,project/root/events/logging_events_bckp,PROD)", + "changeType": "UPSERT", + "aspectName": "upstreamLineage", + "aspect": { + "json": { + "upstreams": [ + { + "auditStamp": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "dataset": "urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD)", + "type": "COPY" } ] } }, "systemMetadata": { - "lastObserved": 1758537741932, + "lastObserved": 1758537741933, "runId": "demo-data-2025_09_22-16_12_20-modc1r", "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DatasetSnapshot": { - "urn": "urn:li:dataset:(urn:li:dataPlatform:s3,project/root/events/logging_events_bckp,PROD)", - "aspects": [ - { - "com.linkedin.pegasus2avro.common.Status": { - "removed": false - } - }, + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:s3,project/root/events/logging_events_bckp,PROD)", + "changeType": "UPSERT", + "aspectName": "schemaMetadata", + "aspect": { + "json": { + "schemaName": "SampleHiveSchema", + "platform": "urn:li:dataPlatform:hive", + "version": 0, + "created": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "lastModified": { + "time": 1747341257143, + "actor": "urn:li:corpuser:jdoe" + }, + "hash": "", + "platformSchema": { + "com.linkedin.schema.KafkaSchema": { + "documentSchema": "{\"type\":\"record\",\"name\":\"SampleHiveSchema\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"Sample Hive dataset\",\"fields\":[{\"name\":\"field_foo\",\"type\":[\"string\"]},{\"name\":\"field_bar\",\"type\":[\"boolean\"]}]}", + "documentSchemaType": "AVRO" + } + }, + "fields": [ { - "com.linkedin.pegasus2avro.dataset.DatasetProperties": { - "customProperties": { - "encoding": "utf-8" - }, - "description": "s3 backup of logging events", - "tags": [] - } + "fieldPath": "event_name", + "nullable": false, + "description": "Name of your logging event", + "type": { + "type": { + "com.linkedin.schema.BooleanType": {} + } + }, + "nativeDataType": "varchar(100)", + "recursive": false, + "isPartOfKey": false }, { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ - { - "owner": "urn:li:corpuser:jdoe", - "type": "DATAOWNER" - }, - { - "owner": "urn:li:corpuser:datahub", - "type": "DATAOWNER" - } - ], - "ownerTypes": {}, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" + "fieldPath": "event_data", + "nullable": false, + "description": "Data of your event", + "type": { + "type": { + "com.linkedin.schema.BooleanType": {} } - } + }, + "nativeDataType": "boolean", + "recursive": false, + "isPartOfKey": false }, { - "com.linkedin.pegasus2avro.dataset.UpstreamLineage": { - "upstreams": [ - { - "auditStamp": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "dataset": "urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD)", - "type": "COPY" - } - ] - } + "fieldPath": "timestamp", + "nullable": false, + "description": "TS the event was ingested", + "type": { + "type": { + "com.linkedin.schema.BooleanType": {} + } + }, + "nativeDataType": "boolean", + "recursive": false, + "isPartOfKey": false }, { - "com.linkedin.pegasus2avro.schema.SchemaMetadata": { - "schemaName": "SampleHiveSchema", - "platform": "urn:li:dataPlatform:hive", - "version": 0, - "created": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "lastModified": { - "time": 1747341257143, - "actor": "urn:li:corpuser:jdoe" - }, - "hash": "", - "platformSchema": { - "com.linkedin.pegasus2avro.schema.KafkaSchema": { - "documentSchema": "{\"type\":\"record\",\"name\":\"SampleHiveSchema\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"Sample Hive dataset\",\"fields\":[{\"name\":\"field_foo\",\"type\":[\"string\"]},{\"name\":\"field_bar\",\"type\":[\"boolean\"]}]}", - "documentSchemaType": "AVRO" - } - }, - "fields": [ - { - "fieldPath": "event_name", - "nullable": false, - "description": "Name of your logging event", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "varchar(100)", - "recursive": false, - "isPartOfKey": false - }, - { - "fieldPath": "event_data", - "nullable": false, - "description": "Data of your event", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "boolean", - "recursive": false, - "isPartOfKey": false - }, - { - "fieldPath": "timestamp", - "nullable": false, - "description": "TS the event was ingested", - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "boolean", - "recursive": false, - "isPartOfKey": false - }, - { - "fieldPath": "browser", - "nullable": false, - "type": { - "type": { - "com.linkedin.pegasus2avro.schema.StringType": {} - } - }, - "nativeDataType": "string", - "recursive": false, - "isPartOfKey": false - } - ] - } + "fieldPath": "browser", + "nullable": false, + "type": { + "type": { + "com.linkedin.schema.StringType": {} + } + }, + "nativeDataType": "string", + "recursive": false, + "isPartOfKey": false } ] } diff --git a/metadata-ingestion/examples/recipes/example_to_datahub_rest2.dhub.yaml b/metadata-ingestion/examples/recipes/example_to_datahub_rest2.dhub.yaml deleted file mode 100644 index 79081e6b8312..000000000000 --- a/metadata-ingestion/examples/recipes/example_to_datahub_rest2.dhub.yaml +++ /dev/null @@ -1,11 +0,0 @@ -# see https://docs.datahub.com/docs/generated/ingestion/sources/file for complete documentation -source: - type: "file" - config: - filename: "./examples/mce_files/bootstrap_mce2.json" - -# see https://docs.datahub.com/docs/metadata-ingestion/sink_docs/datahub for complete documentation -sink: - type: "datahub-rest" - config: - server: "http://localhost:8080" diff --git a/metadata-ingestion/tests/integration/azure_ad/azure_ad_mces_golden_empty_group_membership.json b/metadata-ingestion/tests/integration/azure_ad/azure_ad_mces_golden_empty_group_membership.json deleted file mode 100644 index 5a12de1a06fc..000000000000 --- a/metadata-ingestion/tests/integration/azure_ad/azure_ad_mces_golden_empty_group_membership.json +++ /dev/null @@ -1,285 +0,0 @@ -[ - { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.CorpGroupSnapshot": { - "urn": "urn:li:corpGroup:groupDisplayName1", - "aspects": [ - { - "com.linkedin.pegasus2avro.identity.CorpGroupInfo": { - "displayName": "groupDisplayName1", - "admins": [], - "members": [], - "groups": [] - } - } - ] - } - }, - "systemMetadata": { - "lastObserved": 1629795600000, - "runId": "test-azure-ad" - } - }, - { - "entityType": "corpGroup", - "entityUrn": "urn:li:corpGroup:groupDisplayName1", - "changeType": "UPSERT", - "aspectName": "origin", - "aspect": { - "json": { - "type": "EXTERNAL", - "externalType": "AZURE_AD" - } - }, - "systemMetadata": { - "lastObserved": 1629795600000, - "runId": "test-azure-ad" - } - }, - { - "entityType": "corpGroup", - "entityUrn": "urn:li:corpGroup:groupDisplayName1", - "changeType": "UPSERT", - "aspectName": "status", - "aspect": { - "json": { - "removed": false - } - }, - "systemMetadata": { - "lastObserved": 1629795600000, - "runId": "test-azure-ad" - } - }, - { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.CorpGroupSnapshot": { - "urn": "urn:li:corpGroup:groupDisplayName2", - "aspects": [ - { - "com.linkedin.pegasus2avro.identity.CorpGroupInfo": { - "displayName": "groupDisplayName2", - "email": "groupDisplayName2@onmicrosoft.com", - "admins": [], - "members": [], - "groups": [], - "description": "This is an interesting description" - } - } - ] - } - }, - "systemMetadata": { - "lastObserved": 1629795600000, - "runId": "test-azure-ad" - } - }, - { - "entityType": "corpGroup", - "entityUrn": "urn:li:corpGroup:groupDisplayName2", - "changeType": "UPSERT", - "aspectName": "origin", - "aspect": { - "json": { - "type": "EXTERNAL", - "externalType": "AZURE_AD" - } - }, - "systemMetadata": { - "lastObserved": 1629795600000, - "runId": "test-azure-ad" - } - }, - { - "entityType": "corpGroup", - "entityUrn": "urn:li:corpGroup:groupDisplayName2", - "changeType": "UPSERT", - "aspectName": "status", - "aspect": { - "json": { - "removed": false - } - }, - "systemMetadata": { - "lastObserved": 1629795600000, - "runId": "test-azure-ad" - } - }, - { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.CorpGroupSnapshot": { - "urn": "urn:li:corpGroup:groupDisplayName3", - "aspects": [ - { - "com.linkedin.pegasus2avro.identity.CorpGroupInfo": { - "displayName": "groupDisplayName3", - "email": "groupDisplayName3@onmicrosoft.com", - "admins": [], - "members": [], - "groups": [], - "description": "This is an interesting description" - } - } - ] - } - }, - "systemMetadata": { - "lastObserved": 1629795600000, - "runId": "test-azure-ad" - } - }, - { - "entityType": "corpGroup", - "entityUrn": "urn:li:corpGroup:groupDisplayName3", - "changeType": "UPSERT", - "aspectName": "origin", - "aspect": { - "json": { - "type": "EXTERNAL", - "externalType": "AZURE_AD" - } - }, - "systemMetadata": { - "lastObserved": 1629795600000, - "runId": "test-azure-ad" - } - }, - { - "entityType": "corpGroup", - "entityUrn": "urn:li:corpGroup:groupDisplayName3", - "changeType": "UPSERT", - "aspectName": "status", - "aspect": { - "json": { - "removed": false - } - }, - "systemMetadata": { - "lastObserved": 1629795600000, - "runId": "test-azure-ad" - } - }, - { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.CorpUserSnapshot": { - "urn": "urn:li:corpuser:johngreen@acryl.io", - "aspects": [ - { - "com.linkedin.pegasus2avro.identity.CorpUserInfo": { - "active": true, - "displayName": "John Green", - "email": "johngreen@acryl.io", - "firstName": "John", - "lastName": "Green", - "fullName": "John Green" - } - }, - { - "com.linkedin.pegasus2avro.identity.GroupMembership": { - "groups": [ - "urn:li:corpGroup:groupDisplayName1", - "urn:li:corpGroup:groupDisplayName2", - "urn:li:corpGroup:groupDisplayName3" - ] - } - } - ] - } - }, - "systemMetadata": { - "lastObserved": 1629795600000, - "runId": "test-azure-ad" - } - }, - { - "entityType": "corpuser", - "entityUrn": "urn:li:corpuser:johngreen@acryl.io", - "changeType": "UPSERT", - "aspectName": "origin", - "aspect": { - "json": { - "type": "EXTERNAL", - "externalType": "AZURE_AD" - } - }, - "systemMetadata": { - "lastObserved": 1629795600000, - "runId": "test-azure-ad" - } - }, - { - "entityType": "corpuser", - "entityUrn": "urn:li:corpuser:johngreen@acryl.io", - "changeType": "UPSERT", - "aspectName": "status", - "aspect": { - "json": { - "removed": false - } - }, - "systemMetadata": { - "lastObserved": 1629795600000, - "runId": "test-azure-ad" - } - }, - { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.CorpUserSnapshot": { - "urn": "urn:li:corpuser:adamhall@acryl.io", - "aspects": [ - { - "com.linkedin.pegasus2avro.identity.CorpUserInfo": { - "active": true, - "displayName": "Adam Hall", - "email": "adamhall@acryl.io", - "firstName": "Adam", - "lastName": "Hall", - "fullName": "Adam Hall" - } - }, - { - "com.linkedin.pegasus2avro.identity.GroupMembership": { - "groups": [ - ] - } - } - ] - } - }, - "systemMetadata": { - "lastObserved": 1629795600000, - "runId": "test-azure-ad" - } - }, - { - "entityType": "corpuser", - "entityUrn": "urn:li:corpuser:adamhall@acryl.io", - "changeType": "UPSERT", - "aspectName": "origin", - "aspect": { - "json": { - "type": "EXTERNAL", - "externalType": "AZURE_AD" - } - }, - "systemMetadata": { - "lastObserved": 1629795600000, - "runId": "test-azure-ad" - } - }, - { - "entityType": "corpuser", - "entityUrn": "urn:li:corpuser:adamhall@acryl.io", - "changeType": "UPSERT", - "aspectName": "status", - "aspect": { - "json": { - "removed": false - } - }, - "systemMetadata": { - "lastObserved": 1629795600000, - "runId": "test-azure-ad" - } - } -] \ No newline at end of file From 2743793e59e3df93a9c90c0b3280bad3697d4fca Mon Sep 17 00:00:00 2001 From: avi <252974426+aviraj-gour@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:42:50 +0530 Subject: [PATCH 05/20] docs(ingest): teach MCPs in examples and docs The REST lineage example emits an UpstreamLineage MCP like its Kafka twin, the custom transformer PATCH example is a transform_aspect, and the file-ingestion JSON samples are MCPs. adding-source points new sources at MetadataChangeProposalWrapper and the SDK entity classes. --- .../sphinx/apidocs/builder/mce-builder.rst | 2 +- docs/how/add-custom-data-platform.md | 27 +++++------- docs/how/add-user-data.md | 38 +++++----------- docs/troubleshooting/quickstart.md | 44 ++++++------------- metadata-ingestion/adding-source.md | 9 ++-- .../docs/transformer/dataset_transformer.md | 40 +++++++---------- .../docs/transformer/set_attribution.md | 4 +- .../examples/library/lineage_emitter_rest.py | 23 +++++++--- 8 files changed, 76 insertions(+), 111 deletions(-) diff --git a/docs-website/sphinx/apidocs/builder/mce-builder.rst b/docs-website/sphinx/apidocs/builder/mce-builder.rst index 4c457557ac14..5f30b72e35c4 100644 --- a/docs-website/sphinx/apidocs/builder/mce-builder.rst +++ b/docs-website/sphinx/apidocs/builder/mce-builder.rst @@ -1,7 +1,7 @@ MCE Builder ======= -These classes and methods make it easier to construct MetadataChangeEvents. +These functions make it easier to build URNs and aspects. .. automodule:: datahub.emitter.mce_builder :member-order: alphabetical diff --git a/docs/how/add-custom-data-platform.md b/docs/how/add-custom-data-platform.md index a35ca84f4865..5f1ff0395fa3 100644 --- a/docs/how/add-custom-data-platform.md +++ b/docs/how/add-custom-data-platform.md @@ -52,23 +52,18 @@ datahub put platform --name MyCustomDataPlatform --display_name "My Custom Data // my-custom-data-platform.json [ { - "auditHeader": null, - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DataPlatformSnapshot": { - "urn": "urn:li:dataPlatform:MyCustomDataPlatform", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataplatform.DataPlatformInfo": { - "datasetNameDelimiter": "/", - "name": "My Custom Data Platform", - "type": "OTHERS", - "logoUrl": "https://" - } - } - ] + "entityType": "dataPlatform", + "entityUrn": "urn:li:dataPlatform:MyCustomDataPlatform", + "changeType": "UPSERT", + "aspectName": "dataPlatformInfo", + "aspect": { + "json": { + "datasetNameDelimiter": "/", + "name": "My Custom Data Platform", + "type": "OTHERS", + "logoUrl": "https://" } - }, - "proposedDelta": null + } } ] ``` diff --git a/docs/how/add-user-data.md b/docs/how/add-user-data.md index d03c51d316b8..1a076c36420b 100644 --- a/docs/how/add-user-data.md +++ b/docs/how/add-user-data.md @@ -17,33 +17,17 @@ Define a JSON File containing your user ```my-user.json [ { - "auditHeader": null, - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.CorpUserSnapshot": { - "urn": "urn:li:corpuser:aseem.bansal", - "aspects": [ - { - "com.linkedin.pegasus2avro.identity.CorpUserInfo": { - "active": true, - "displayName": { - "string": "Aseem Bansal" - }, - "email": "aseem+examples@acryl.io", - "title": { - "string": "Software Engineer" - }, - "managerUrn": null, - "departmentId": null, - "departmentName": null, - "firstName": null, - "lastName": null, - "fullName": { - "string": "Aseem Bansal" - }, - "countryCode": null - } - } - ] + "entityType": "corpuser", + "entityUrn": "urn:li:corpuser:aseem.bansal", + "changeType": "UPSERT", + "aspectName": "corpUserInfo", + "aspect": { + "json": { + "active": true, + "displayName": "Aseem Bansal", + "email": "aseem+examples@acryl.io", + "title": "Software Engineer", + "fullName": "Aseem Bansal" } } } diff --git a/docs/troubleshooting/quickstart.md b/docs/troubleshooting/quickstart.md index df033bf95198..0f20f360d964 100644 --- a/docs/troubleshooting/quickstart.md +++ b/docs/troubleshooting/quickstart.md @@ -304,8 +304,7 @@ ALTER TABLE metadata_aspect_v2 CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_ Currently, `user.props` is a file used by the JAAS PropertyFileLoginModule solely for the purpose of **Authentication**. The file is not used as an source from which to ingest additional metadata about the user. For that, you'll need to ingest some custom information about your new user using the Rest.li APIs or the [Metadata File ingestion source](../generated/ingestion/sources/metadata-file.md). -For an example of a file that ingests user information, check out [single_mce.json](https://github.com/datahub-project/datahub/blob/master/metadata-ingestion/examples/mce_files/single_mce.json), which ingests a single user object into DataHub. Notice that the "urn" field provided -will need to align with the custom username you've provided in user.props file. For example, if your user.props file contains: +The `entityUrn` of the user you ingest will need to align with the custom username you've provided in user.props file. For example, if your user.props file contains: ``` my-custom-user:my-custom-password @@ -315,36 +314,19 @@ You'll need to ingest some metadata of the following form to see it inside the D ``` { - "auditHeader": null, - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.CorpUserSnapshot": { - "urn": "urn:li:corpuser:my-custom-user", - "aspects": [ - { - "com.linkedin.pegasus2avro.identity.CorpUserInfo": { - "active": true, - "displayName": { - "string": "The name of the custom user" - }, - "email": "my-custom-user-email@example.io", - "title": { - "string": "Engineer" - }, - "managerUrn": null, - "departmentId": null, - "departmentName": null, - "firstName": null, - "lastName": null, - "fullName": { - "string": "My Custom User" - }, - "countryCode": null - } - } - ] + "entityType": "corpuser", + "entityUrn": "urn:li:corpuser:my-custom-user", + "changeType": "UPSERT", + "aspectName": "corpUserInfo", + "aspect": { + "json": { + "active": true, + "displayName": "The name of the custom user", + "email": "my-custom-user-email@example.io", + "title": "Engineer", + "fullName": "My Custom User" } - }, - "proposedDelta": null + } } ``` diff --git a/metadata-ingestion/adding-source.md b/metadata-ingestion/adding-source.md index 7ebbd732dd41..034ccffab16f 100644 --- a/metadata-ingestion/adding-source.md +++ b/metadata-ingestion/adding-source.md @@ -71,12 +71,13 @@ Some sources use the default `SourceReport` class, but others inherit and extend ### 3. Implement the source itself -The core for the source is the `get_workunits_internal` method, which produces a stream of metadata events (typically MCP objects) wrapped up in a MetadataWorkUnit. -The [file source](./src/datahub/ingestion/source/file.py) is a good and simple example. +The core for the source is the `get_workunits_internal` method, which produces a stream of MetadataWorkUnits. +Build one `MetadataChangeProposalWrapper` per aspect and call `.as_workunit()` on it, or use the +[SDK entity classes](./src/datahub/sdk/) and their `as_workunits()`. -The MetadataChangeEventClass is defined in the metadata models which are generated +The aspect classes are defined in the metadata models which are generated under `metadata-ingestion/src/datahub/metadata/schema_classes.py`. There are also -some [convenience methods](./src/datahub/emitter/mce_builder.py) for commonly used operations. +some [convenience methods](./src/datahub/emitter/mce_builder.py) for building URNs. ### 4. Set up the dependencies diff --git a/metadata-ingestion/docs/transformer/dataset_transformer.md b/metadata-ingestion/docs/transformer/dataset_transformer.md index d809ffb5f63f..d29913a2afa1 100644 --- a/metadata-ingestion/docs/transformer/dataset_transformer.md +++ b/metadata-ingestion/docs/transformer/dataset_transformer.md @@ -1815,31 +1815,25 @@ datahub_api: #### Advanced Use-Case: Patching Owners With the above capability, we can now build more powerful transformers that can check with the server-side state before issuing changes in metadata. -e.g. Here is how the AddDatasetOwnership transformer can now support PATCH semantics by ensuring that it never deletes any owners that are stored on the server. +e.g. If `AddCustomOwnershipConfig` also had a `semantics: TransformerSemantics` field, here is how the `transform_aspect()` of `AddCustomOwnership` could support PATCH semantics by ensuring that it never deletes any owners that are stored on the server. ```python -def transform_one(self, mce: MetadataChangeEventClass) -> MetadataChangeEventClass: - if not isinstance(mce.proposedSnapshot, DatasetSnapshotClass): - return mce - owners_to_add = self.config.get_owners_to_add(mce.proposedSnapshot) - if owners_to_add: - ownership = builder.get_or_add_aspect( - mce, - OwnershipClass( - owners=[], - ), - ) - ownership.owners.extend(owners_to_add) - - if self.config.semantics == TransformerSemantics.PATCH: - assert self.ctx.graph - patch_ownership = AddDatasetOwnership.get_ownership_to_set( - self.ctx.graph, mce.proposedSnapshot.urn, ownership - ) - builder.set_aspect( - mce, aspect=patch_ownership, aspect_type=OwnershipClass - ) - return mce +def transform_aspect( # type: ignore + self, entity_urn: str, aspect_name: str, aspect: Optional[OwnershipClass] +) -> Optional[OwnershipClass]: + ownership = aspect if aspect else OwnershipClass(owners=[]) + ownership.owners.extend(self.owners) + + if self.config.semantics == TransformerSemantics.PATCH: + assert self.ctx.graph + server_ownership = self.ctx.graph.get_ownership(entity_urn=entity_urn) + if server_ownership: + ownership.owners = server_ownership.owners + [ + owner + for owner in ownership.owners + if owner not in server_ownership.owners + ] + return ownership ``` ### Installing the package diff --git a/metadata-ingestion/docs/transformer/set_attribution.md b/metadata-ingestion/docs/transformer/set_attribution.md index 844ad60d1156..69b46029e1c5 100644 --- a/metadata-ingestion/docs/transformer/set_attribution.md +++ b/metadata-ingestion/docs/transformer/set_attribution.md @@ -22,9 +22,7 @@ This transformer applies to every entity type. Aspects other than the three abov :::warning Sources that emit MCEs lose their other aspects -If your source emits `MetadataChangeEvent`s (MCEs), which carry several aspects per entity in one snapshot, only the three aspects above are forwarded — anything else in that MCE, such as a description or custom properties, is dropped. Sources that emit `MetadataChangeProposal`s (MCPs), which carry a single aspect each, are unaffected. See [MetadataChangeProposal & MetadataChangeLog](/docs/advanced/mcp-mcl.md) for the distinction. - -If you are unsure which your source emits, run the pipeline into a `file` sink with and without this transformer and compare which aspects appear. +For a `MetadataChangeEvent` (MCE), only the three aspects above are forwarded and its other aspects are dropped. To check what a source emits, run it into a `file` sink. ::: ## Config Details diff --git a/metadata-ingestion/examples/library/lineage_emitter_rest.py b/metadata-ingestion/examples/library/lineage_emitter_rest.py index e2d293660b87..266a1e4a83a0 100644 --- a/metadata-ingestion/examples/library/lineage_emitter_rest.py +++ b/metadata-ingestion/examples/library/lineage_emitter_rest.py @@ -1,16 +1,27 @@ import datahub.emitter.mce_builder as builder +from datahub.emitter.mcp import MetadataChangeProposalWrapper from datahub.emitter.rest_emitter import DatahubRestEmitter +from datahub.metadata.schema_classes import ( + DatasetLineageTypeClass, + UpstreamClass, + UpstreamLineageClass, +) # Construct a lineage object. -lineage_mce = builder.make_lineage_mce( - [ - builder.make_dataset_urn("hive", "fct_users_deleted"), # Upstream - ], - builder.make_dataset_urn("hive", "logging_events"), # Downstream +lineage_mcp = MetadataChangeProposalWrapper( + entityUrn=builder.make_dataset_urn("hive", "logging_events"), # Downstream + aspect=UpstreamLineageClass( + upstreams=[ + UpstreamClass( + dataset=builder.make_dataset_urn("hive", "fct_users_deleted"), + type=DatasetLineageTypeClass.TRANSFORMED, + ), + ] + ), ) # Create an emitter to the GMS REST API. emitter = DatahubRestEmitter("http://localhost:8080") # Emit metadata! -emitter.emit_mce(lineage_mce) +emitter.emit(lineage_mcp) From decbb7150f4bb7f22dd5b135343140913f8d3365 Mon Sep 17 00:00:00 2001 From: avi <252974426+aviraj-gour@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:46:23 +0530 Subject: [PATCH 06/20] fix(ingest/rest): send MCEs as MCPs from the REST emitter DataHubRestEmitter.emit() and emit_mce() now convert a MetadataChangeEvent with mcps_from_mce and emit each aspect through emit_mcp, so MCE input uses ingestProposal (or OpenAPI) and honours emit_mode instead of posting to /entities?action=ingest. Both warn with DataHubDeprecationWarning, and the deprecation is logged once per process. An MCE with no aspects emits nothing and logs a warning. The datahub-rest sink's SYNC/ASYNC path expands MCEs itself, like its ASYNC_BATCH path and the Kafka sink, so recipe users get no warning about emitter code they do not own. This mirrors the Kafka emitter change in #20962. --- docs/how/breaking-changes.md | 4 + .../src/datahub/emitter/rest_emitter.py | 62 +++--- .../datahub/ingestion/sink/datahub_rest.py | 6 +- .../tests/unit/sdk/test_rest_emitter.py | 148 +++++++++++++- .../tests/unit/test_rest_sink.py | 189 +++++++++--------- 5 files changed, 279 insertions(+), 130 deletions(-) diff --git a/docs/how/breaking-changes.md b/docs/how/breaking-changes.md index 1eaccfe29df9..42c7bad2c521 100644 --- a/docs/how/breaking-changes.md +++ b/docs/how/breaking-changes.md @@ -660,6 +660,8 @@ Requirements: - [#20962](https://github.com/datahub-project/datahub/pull/20962) **(Ingestion / Kafka emitter, Airflow)** Emitting a `MetadataChangeEvent` with `DatahubKafkaEmitter` (`emit` or `emit_mce_async`) is deprecated. **Action:** emit `MetadataChangeProposalWrapper` instead. +- **(Ingestion / REST emitter)** Emitting a `MetadataChangeEvent` with `DatahubRestEmitter` or `DataHubGraph` (`emit` or `emit_mce`) is deprecated and will be removed in a future release. **Action:** emit `MetadataChangeProposalWrapper` instead. + ### Other Notable Changes - [#21554](https://github.com/datahub-project/datahub/pull/21554) **(Ingestion / Grafana)** Grafana ingestion no longer stops or runs forever when Grafana returns unexpected data. Dashboards, search results and panels that cannot be read are skipped and listed as warnings in the ingestion report (`Dashboard Fetch Error`, `Dashboard Parse Error`, `Dashboard Search Result Skipped`, `Panel Skipped`); one bad panel no longer drops the other panels on its dashboard. A dashboard search response that is not a list is reported as a `Dashboard Search Error` failure, and if Grafana keeps returning the same full page, paging stops with a `Paging Stopped` failure. If stateful ingestion removes stale metadata, a run that skips dashboards is also marked as failed and removes no stale metadata, so that the skipped dashboards are not deleted from DataHub. `skip_text_panels: true` now takes effect; before, text panels were still ingested as charts. **Action:** none. Expect new warnings in the report where these problems were previously silent or stopped ingestion. If you set `skip_text_panels: true`, text-panel charts ingested earlier are removed as stale on the next run with stale-metadata removal on. @@ -682,6 +684,8 @@ Requirements: - [#21116](https://github.com/datahub-project/datahub/pull/21116) **(GMS / Search)** New `siblingGroups` GraphQL query, used by the search "Show siblings" option and the dataset "Composed of" section. It is off by default: set `GRAPHQL_QUERY_MAX_SIBLING_GROUP_URNS` above 0 (the search UI sends up to 30 urns per page) to turn it on. Each request walks up to 1,000 sibling-group members per dataset, and with view authorization on (`VIEW_AUTHORIZATION_ENABLED`) it view-checks every member, so test it on your largest sibling groups before enabling. **Action:** none unless you want the feature. +- **(Ingestion / REST emitter)** `DatahubRestEmitter` and `DataHubGraph` now send a `MetadataChangeEvent` as one MCP per aspect through `ingestProposal` (or the OpenAPI endpoint with `openapi_ingestion` on) instead of posting it to `/entities?action=ingest`. This also applies to the `datahub-rest` sink in `SYNC` and `ASYNC` mode; the default `ASYNC_BATCH` mode already sent MCPs. The stored aspects are the same, and the `emit_mode` passed to `emit` now applies to MCEs too. An MCE is no longer written all-or-nothing: if GMS rejects one aspect, the aspects before it stay stored, `emit` raises for the rejected one and the rest are not sent. An MCE with no aspects is no longer sent at all. **Action:** none, unless you rely on an MCE being written atomically. + - [#21155](https://github.com/datahub-project/datahub/pull/21155) **(Ingestion / datahub-gc)** The soft-deleted entity cleanup no longer hard-deletes a soft-deleted container that still has child entities, including soft-deleted, draft or hidden ones (on a server without the `includeHiddenLifecycleStages` search flag, hidden children are not counted). Hard-deleting it left every child linked to a container that no longer exists (before #20589, it removed the link altogether), so the subtree could not be restored. Such containers now stay soft-deleted, are counted in `num_soft_deleted_containers_retained_with_children`, and are listed in the run report. A subtree that is soft-deleted as a whole is now removed one level per run, children first, so a tree N levels deep takes N runs. **Action:** none. Restore the container to bring its subtree back, or delete its children so a later run can remove it. - [#20589](https://github.com/datahub-project/datahub/pull/20589) **(Ingestion / datahub-gc, CLI)** When the soft-deleted entity cleanup hard-deletes an entity, it now removes references to it only for the types `datahub delete --hard` already handles this way: tags, users, groups, domains, glossary terms and nodes, forms and roles. Before, it did this for every type, which could delete data from entities that still exist. Purging a data flow hard-deleted all of its data jobs, including live ones, and purging a container removed the parent link from all of its children. References to other purged entities, such as a dataset listed in another dataset's upstream lineage, now stay in place, as they already do after `datahub delete --hard`. Both commands now also remove references before the hard delete rather than after, so the cleanup no longer misses them. Roles can now be soft-deleted. **Action:** none. diff --git a/metadata-ingestion/src/datahub/emitter/rest_emitter.py b/metadata-ingestion/src/datahub/emitter/rest_emitter.py index 2c76cde710fb..6f3dbe32f3f0 100644 --- a/metadata-ingestion/src/datahub/emitter/rest_emitter.py +++ b/metadata-ingestion/src/datahub/emitter/rest_emitter.py @@ -7,6 +7,7 @@ import re import socket import time +import warnings from collections import defaultdict from dataclasses import dataclass, field from datetime import datetime, timedelta @@ -80,6 +81,7 @@ ) from datahub.emitter.serialization_helper import pre_json_transform from datahub.emitter.token_provider import TokenProviderAuth +from datahub.errors import DataHubDeprecationWarning from datahub.ingestion.api.closeable import Closeable from datahub.ingestion.auth.env import build_auth_config_from_env from datahub.ingestion.auth.registry import build_token_provider @@ -145,6 +147,12 @@ # This applies to pretty much all calls to GMS. INGEST_MAX_PAYLOAD_BYTES = get_rest_emitter_batch_max_payload_bytes() +_MCE_DEPRECATION_MESSAGE = ( + "Emitting MetadataChangeEvents is deprecated and will be removed in a " + "future release. They are converted to MCPs; emit " + "MetadataChangeProposalWrapper instead." +) + # This limit is somewhat arbitrary. All GMS endpoints will timeout # and return a 500 if processing takes too long. To avoid sending # too much to the backend and hitting a timeout, we try to limit @@ -833,7 +841,10 @@ def emit( ): self.emit_mcp(item, emit_mode=emit_mode) else: - self.emit_mce(item) + warnings.warn( + _MCE_DEPRECATION_MESSAGE, DataHubDeprecationWarning, stacklevel=2 + ) + self._emit_mce(item, emit_mode) except Exception as e: if callback: callback(e, str(e)) @@ -842,35 +853,22 @@ def emit( if callback: callback(None, "success") # type: ignore + @deprecated(_MCE_DEPRECATION_MESSAGE, category=DataHubDeprecationWarning) def emit_mce(self, mce: MetadataChangeEvent) -> None: - url = f"{self._gms_server}/entities?action=ingest" - - raw_mce_obj = mce.proposedSnapshot.to_obj() - mce_obj = pre_json_transform(raw_mce_obj) - snapshot_fqn = ( - f"com.linkedin.metadata.snapshot.{mce.proposedSnapshot.RECORD_SCHEMA.name}" - ) - ensure_has_system_metadata(mce) - # To make lint happy - assert mce.systemMetadata is not None - system_metadata_obj = mce.systemMetadata.to_obj() - snapshot = { - "entity": {"value": {snapshot_fqn: mce_obj}}, - "systemMetadata": system_metadata_obj, - } - payload = json.dumps(snapshot) - if len(payload) > INGEST_MAX_PAYLOAD_BYTES: - logger.warning( - f"MCE object has size {len(payload)} that exceeds the max payload size of {INGEST_MAX_PAYLOAD_BYTES}, " - "so this metadata will likely fail to be emitted." - ) - - response = self._emit_generic(url, payload) - logger.debug( - "Sent MCE successfully urn=%s status=%d", - mce.proposedSnapshot.urn, - response.status_code, - ) + """Emit an MCE as one MCP per aspect, with the default emit mode.""" + self._emit_mce(mce, self._default_emit_mode) + + def _emit_mce(self, mce: MetadataChangeEvent, emit_mode: EmitMode) -> None: + """Not atomic: if emitting aspect k raises, the aspects before it were already sent and the rest are not.""" + # Deferred to break the cycle mcp_builder -> ingestion.api.common -> graph.client -> rest_emitter. + from datahub.emitter.mcp_builder import mcps_from_mce + + _warn_mce_deprecated() + mcps = list(mcps_from_mce(mce)) + if not mcps: + logger.warning(f"MCE for {mce.proposedSnapshot.urn} produced zero MCPs") + for mcp in mcps: + self.emit_mcp(mcp, emit_mode=emit_mode) @overload @deprecated("Use emit_mode instead of async_flag") @@ -1441,3 +1439,9 @@ def close(self) -> None: """This class exists as a pass-through for backwards compatibility""" DatahubRestEmitter = DataHubRestEmitter + + +# Cached so the warning prints once per process, however many emitters or MCEs there are. +@functools.lru_cache(maxsize=None) +def _warn_mce_deprecated() -> None: + logger.warning(_MCE_DEPRECATION_MESSAGE) diff --git a/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py b/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py index ed84513f2a4f..342c48afe4bd 100644 --- a/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py +++ b/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py @@ -408,7 +408,11 @@ def _emit_wrapper( emit_mode: EmitMode, ) -> None: # TODO: Add timing metrics - self.emitter.emit(record, emit_mode=emit_mode) + if isinstance(record, MetadataChangeEvent): + for mcp in mcps_from_mce(record): + self.emitter.emit(mcp, emit_mode=emit_mode) + else: + self.emitter.emit(record, emit_mode=emit_mode) def _emit_batch_wrapper( self, diff --git a/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py b/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py index 0d72ec3ee9c3..04bb27e90470 100644 --- a/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py +++ b/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py @@ -21,6 +21,7 @@ from datahub.emitter.mcp import MetadataChangeProposalWrapper from datahub.emitter.response_helper import TraceData from datahub.emitter.rest_emitter import ( + _MCE_DEPRECATION_MESSAGE, BATCH_INGEST_MAX_PAYLOAD_LENGTH, INGEST_MAX_PAYLOAD_BYTES, DataHubRestEmitter, @@ -29,10 +30,11 @@ RequestsSessionConfig, RestSinkEndpoint, _KeepAliveHTTPAdapter, + _warn_mce_deprecated, logger, preserve_unicode_escapes, ) -from datahub.errors import APITracingWarning +from datahub.errors import APITracingWarning, DataHubDeprecationWarning from datahub.ingestion.graph.config import ClientMode from datahub.metadata.com.linkedin.pegasus2avro.common import ( Status, @@ -45,6 +47,9 @@ KEY_ASPECT_NAMES, KEY_ASPECTS, ChangeTypeClass, + DatasetSnapshotClass, + MetadataChangeEventClass, + SystemMetadataClass, ) from datahub.specific.dataset import DatasetPatchBuilder from datahub.utilities.server_config_util import RestServiceConfig @@ -3078,3 +3083,144 @@ def test_restli_batch_coarsens_to_sync_when_any_marked(self, restli_emitter): restli_emitter.emit_mcps([plain], emit_mode=EmitMode.ASYNC) payload = json.loads(mock_emit.call_args[0][1]) assert payload.get("async") == "true" + + +_MCE_URN = "urn:li:dataset:(urn:li:dataPlatform:hive,db.table,PROD)" + + +@pytest.fixture +def mce_emitter() -> DataHubRestEmitter: + _warn_mce_deprecated.cache_clear() + return DataHubRestEmitter( + MOCK_GMS_ENDPOINT, openapi_ingestion=False, default_emit_mode=EmitMode.ASYNC + ) + + +def test_emit_mce_emits_one_mcp_per_aspect(mce_emitter: DataHubRestEmitter) -> None: + status = Status(removed=False) + properties = DatasetProperties(description="d") + mce = MetadataChangeEventClass( + proposedSnapshot=DatasetSnapshotClass( + urn=_MCE_URN, aspects=[status, properties] + ) + ) + callback = Mock() + + with ( + patch.object(mce_emitter, "emit_mcp") as emit_mcp, + pytest.warns(DataHubDeprecationWarning), + ): + mce_emitter.emit(mce, callback=callback, emit_mode=EmitMode.SYNC_WAIT) + + mcps = [c.args[0] for c in emit_mcp.call_args_list] + assert all(isinstance(m, MetadataChangeProposalWrapper) for m in mcps) + assert [(m.entityUrn, m.aspect) for m in mcps] == [ + (_MCE_URN, status), + (_MCE_URN, properties), + ] + assert [c.kwargs["emit_mode"] for c in emit_mcp.call_args_list] == [ + EmitMode.SYNC_WAIT + ] * 2 + callback.assert_called_once_with(None, "success") + + +def test_emit_mce_method_is_deprecated_and_uses_default_emit_mode( + mce_emitter: DataHubRestEmitter, +) -> None: + mce = MetadataChangeEventClass( + proposedSnapshot=DatasetSnapshotClass( + urn=_MCE_URN, aspects=[Status(removed=False)] + ) + ) + with ( + patch.object(mce_emitter, "emit_mcp") as emit_mcp, + pytest.warns(DataHubDeprecationWarning), + ): + mce_emitter.emit_mce(mce) + + emit_mcp.assert_called_once() + assert emit_mcp.call_args.kwargs["emit_mode"] == EmitMode.ASYNC + + +def test_emit_mce_posts_to_ingest_proposal(mce_emitter: DataHubRestEmitter) -> None: + mce = MetadataChangeEventClass( + proposedSnapshot=DatasetSnapshotClass( + urn=_MCE_URN, + aspects=[Status(removed=False), DatasetProperties(description="d")], + ), + systemMetadata=SystemMetadataClass(runId="run-1", lastObserved=1), + ) + response = Mock(spec=Response) + response.status_code = 200 + response.headers = {} + with ( + patch.object( + mce_emitter, "_emit_generic", return_value=response + ) as emit_generic, + pytest.warns(DataHubDeprecationWarning), + ): + mce_emitter.emit(mce) + + urls = [c.args[0] for c in emit_generic.call_args_list] + assert urls == [f"{MOCK_GMS_ENDPOINT}/aspects?action=ingestProposal"] * 2 + proposals = [json.loads(c.args[1])["proposal"] for c in emit_generic.call_args_list] + assert [p["aspectName"] for p in proposals] == ["status", "datasetProperties"] + assert [p["systemMetadata"]["runId"] for p in proposals] == ["run-1"] * 2 + + +def test_emit_mce_with_no_aspects_emits_nothing( + mce_emitter: DataHubRestEmitter, caplog: pytest.LogCaptureFixture +) -> None: + mce = MetadataChangeEventClass( + proposedSnapshot=DatasetSnapshotClass(urn=_MCE_URN, aspects=[]) + ) + callback = Mock() + with ( + patch.object(mce_emitter, "_emit_generic") as emit_generic, + pytest.warns(DataHubDeprecationWarning), + ): + mce_emitter.emit(mce, callback=callback) + + emit_generic.assert_not_called() + callback.assert_called_once_with(None, "success") + assert "produced zero MCPs" in caplog.text + + +def test_emit_mce_failure_stops_and_reaches_callback( + mce_emitter: DataHubRestEmitter, +) -> None: + mce = MetadataChangeEventClass( + proposedSnapshot=DatasetSnapshotClass( + urn=_MCE_URN, + aspects=[Status(removed=False), DatasetProperties(description="d")], + ) + ) + error = OperationalError("rejected") + callback = Mock() + with ( + patch.object(mce_emitter, "emit_mcp", side_effect=error) as emit_mcp, + pytest.warns(DataHubDeprecationWarning), + pytest.raises(OperationalError), + ): + mce_emitter.emit(mce, callback=callback) + + emit_mcp.assert_called_once() + callback.assert_called_once_with(error, str(error)) + + +def test_mce_deprecation_logged_once_per_process( + mce_emitter: DataHubRestEmitter, caplog: pytest.LogCaptureFixture +) -> None: + mce = MetadataChangeEventClass( + proposedSnapshot=DatasetSnapshotClass( + urn=_MCE_URN, aspects=[Status(removed=False)] + ) + ) + with ( + patch.object(mce_emitter, "emit_mcp"), + pytest.warns(DataHubDeprecationWarning), + ): + mce_emitter.emit(mce) + mce_emitter.emit(mce) + + assert caplog.text.count(_MCE_DEPRECATION_MESSAGE) == 1 diff --git a/metadata-ingestion/tests/unit/test_rest_sink.py b/metadata-ingestion/tests/unit/test_rest_sink.py index ecf1b0f56647..42968b063046 100644 --- a/metadata-ingestion/tests/unit/test_rest_sink.py +++ b/metadata-ingestion/tests/unit/test_rest_sink.py @@ -11,6 +11,7 @@ import datahub.metadata.schema_classes as models from datahub.emitter.mcp import MetadataChangeProposalWrapper from datahub.emitter.rest_emitter import DatahubRestEmitter, EmitMode +from datahub.errors import DataHubDeprecationWarning from datahub.ingestion.graph.config import DatahubClientConfig from datahub.ingestion.sink.datahub_rest import ( DatahubRestSink, @@ -54,47 +55,27 @@ ], ), ), - "/entities?action=ingest", + "/aspects?action=ingestProposal", { - "entity": { - "value": { - "com.linkedin.metadata.snapshot.DatasetSnapshot": { - "urn": "urn:li:dataset:(urn:li:dataPlatform:bigquery,downstream,PROD)", - "aspects": [ - { - "com.linkedin.dataset.UpstreamLineage": { - "upstreams": [ - { - "auditStamp": { - "time": 1618987484580, - "actor": "urn:li:corpuser:datahub", - }, - "dataset": "urn:li:dataset:(urn:li:dataPlatform:bigquery,upstream1,PROD)", - "type": "TRANSFORMED", - }, - { - "auditStamp": { - "time": 1618987484580, - "actor": "urn:li:corpuser:datahub", - }, - "dataset": "urn:li:dataset:(urn:li:dataPlatform:bigquery,upstream2,PROD)", - "type": "TRANSFORMED", - }, - ] - } - } - ], - } - } - }, - "systemMetadata": { - "lastObserved": FROZEN_TIME, - "lastRunId": "no-run-id-provided", - "properties": { - "clientId": "acryl-datahub", - "clientVersion": "1!0.0.0.dev0", + "async": "false", + "proposal": { + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:bigquery,downstream,PROD)", + "changeType": "UPSERT", + "aspectName": "upstreamLineage", + "aspect": { + "value": '{"upstreams": [{"auditStamp": {"time": 1618987484580, "actor": "urn:li:corpuser:datahub"}, "dataset": "urn:li:dataset:(urn:li:dataPlatform:bigquery,upstream1,PROD)", "type": "TRANSFORMED"}, {"auditStamp": {"time": 1618987484580, "actor": "urn:li:corpuser:datahub"}, "dataset": "urn:li:dataset:(urn:li:dataPlatform:bigquery,upstream2,PROD)", "type": "TRANSFORMED"}]}', + "contentType": "application/json", + }, + "systemMetadata": { + "lastObserved": FROZEN_TIME, + "lastRunId": "no-run-id-provided", + "properties": { + "clientId": "acryl-datahub", + "clientVersion": "1!0.0.0.dev0", + }, + "runId": "no-run-id-provided", }, - "runId": "no-run-id-provided", }, }, ), @@ -116,43 +97,27 @@ ], ) ), - "/entities?action=ingest", + "/aspects?action=ingestProposal", { - "entity": { - "value": { - "com.linkedin.metadata.snapshot.ChartSnapshot": { - "urn": "urn:li:chart:(superset,227)", - "aspects": [ - { - "com.linkedin.chart.ChartInfo": { - "customProperties": {}, - "title": "Weekly Messages", - "description": "", - "lastModified": { - "created": { - "time": 1618987484580, - "actor": "urn:li:corpuser:datahub", - }, - "lastModified": { - "time": 1618987484580, - "actor": "urn:li:corpuser:datahub", - }, - }, - "type": "SCATTER", - } - } - ], - } - } - }, - "systemMetadata": { - "lastObserved": FROZEN_TIME, - "lastRunId": "no-run-id-provided", - "properties": { - "clientId": "acryl-datahub", - "clientVersion": "1!0.0.0.dev0", + "async": "false", + "proposal": { + "entityType": "chart", + "entityUrn": "urn:li:chart:(superset,227)", + "changeType": "UPSERT", + "aspectName": "chartInfo", + "aspect": { + "value": '{"customProperties": {}, "title": "Weekly Messages", "description": "", "lastModified": {"created": {"time": 1618987484580, "actor": "urn:li:corpuser:datahub"}, "lastModified": {"time": 1618987484580, "actor": "urn:li:corpuser:datahub"}}, "type": "SCATTER"}', + "contentType": "application/json", + }, + "systemMetadata": { + "lastObserved": FROZEN_TIME, + "lastRunId": "no-run-id-provided", + "properties": { + "clientId": "acryl-datahub", + "clientVersion": "1!0.0.0.dev0", + }, + "runId": "no-run-id-provided", }, - "runId": "no-run-id-provided", }, }, ), @@ -170,33 +135,27 @@ ], ) ), - "/entities?action=ingest", + "/aspects?action=ingestProposal", { - "entity": { - "value": { - "com.linkedin.metadata.snapshot.DataJobSnapshot": { - "urn": "urn:li:dataJob:(urn:li:dataFlow:(airflow,dag_abc,PROD),task_456)", - "aspects": [ - { - "com.linkedin.datajob.DataJobInfo": { - "customProperties": {}, - "name": "User Deletions", - "description": "Constructs the fct_users_deleted from logging_events", - "type": {"string": "SQL"}, - } - } - ], - } - } - }, - "systemMetadata": { - "lastObserved": FROZEN_TIME, - "lastRunId": "no-run-id-provided", - "properties": { - "clientId": "acryl-datahub", - "clientVersion": "1!0.0.0.dev0", + "async": "false", + "proposal": { + "entityType": "dataJob", + "entityUrn": "urn:li:dataJob:(urn:li:dataFlow:(airflow,dag_abc,PROD),task_456)", + "changeType": "UPSERT", + "aspectName": "dataJobInfo", + "aspect": { + "value": '{"customProperties": {}, "name": "User Deletions", "description": "Constructs the fct_users_deleted from logging_events", "type": {"string": "SQL"}}', + "contentType": "application/json", + }, + "systemMetadata": { + "lastObserved": FROZEN_TIME, + "lastRunId": "no-run-id-provided", + "properties": { + "clientId": "acryl-datahub", + "clientVersion": "1!0.0.0.dev0", + }, + "runId": "no-run-id-provided", }, - "runId": "no-run-id-provided", }, }, ), @@ -307,6 +266,8 @@ def match_request_text(request: requests.Request) -> bool: ) with contextlib.ExitStack() as stack: + if isinstance(record, models.MetadataChangeEventClass): + stack.enter_context(pytest.warns(DataHubDeprecationWarning)) if isinstance(record, models.UsageAggregationClass): stack.enter_context( pytest.warns( @@ -512,3 +473,33 @@ def test_rest_sink_config_accepts_client_config_dump(): client = DatahubClientConfig(server="http://localhost:8080") cfg = DatahubRestSinkConfig(**client.model_dump()) assert cfg.server == "http://localhost:8080" + + +def test_emit_wrapper_sends_mce_as_one_mcp_per_aspect(): + from unittest.mock import PropertyMock, patch + + status = models.StatusClass(removed=False) + properties = models.DatasetPropertiesClass(description="d") + mce = models.MetadataChangeEventClass( + proposedSnapshot=models.DatasetSnapshotClass( + urn="urn:li:dataset:(urn:li:dataPlatform:foo,bar,PROD)", + aspects=[status, properties], + ) + ) + mock_emitter = MagicMock() + with ( + patch.object(DatahubRestSink, "__init__", lambda self, *args, **kwargs: None), + patch.object( + DatahubRestSink, "emitter", new_callable=PropertyMock + ) as mock_emitter_prop, + ): + mock_emitter_prop.return_value = mock_emitter + sink = DatahubRestSink.__new__(DatahubRestSink) + sink._emit_wrapper(mce, emit_mode=EmitMode.SYNC_PRIMARY) + + emitted = [c.args[0] for c in mock_emitter.emit.call_args_list] + assert all(isinstance(m, MetadataChangeProposalWrapper) for m in emitted) + assert [m.aspect for m in emitted] == [status, properties] + assert {c.kwargs["emit_mode"] for c in mock_emitter.emit.call_args_list} == { + EmitMode.SYNC_PRIMARY + } From 22bb7d4491500be2b372d325f9bae24e39690bda Mon Sep 17 00:00:00 2001 From: avi <252974426+aviraj-gour@users.noreply.github.com> Date: Mon, 16 Nov 2026 17:56:58 +0530 Subject: [PATCH 07/20] fix(ingest/file): read MCEs as MCPs in the file source The file source turns each MetadataChangeEvent it reads into one MCP per aspect and reports one deprecation warning per file, so transformers and sinks only receive MCPs. Reading MCEs will be removed in a future release. --- docs/how/breaking-changes.md | 4 ++ .../src/datahub/ingestion/source/file.py | 13 +++- .../remote/golden/remote_file_golden.json | 62 +++++++++---------- .../tests/unit/serde/test_serde.py | 23 +++++++ 4 files changed, 69 insertions(+), 33 deletions(-) diff --git a/docs/how/breaking-changes.md b/docs/how/breaking-changes.md index 42c7bad2c521..41bdc4325c3e 100644 --- a/docs/how/breaking-changes.md +++ b/docs/how/breaking-changes.md @@ -662,6 +662,8 @@ Requirements: - **(Ingestion / REST emitter)** Emitting a `MetadataChangeEvent` with `DatahubRestEmitter` or `DataHubGraph` (`emit` or `emit_mce`) is deprecated and will be removed in a future release. **Action:** emit `MetadataChangeProposalWrapper` instead. +- **(Ingestion / file source)** Reading `MetadataChangeEvent` records with the `file` source is deprecated and will be removed in a future release. The run report shows a warning for each file that contains them. **Action:** rewrite the file as MCPs, for example by running it through the `file` source into the `file` sink. + ### Other Notable Changes - [#21554](https://github.com/datahub-project/datahub/pull/21554) **(Ingestion / Grafana)** Grafana ingestion no longer stops or runs forever when Grafana returns unexpected data. Dashboards, search results and panels that cannot be read are skipped and listed as warnings in the ingestion report (`Dashboard Fetch Error`, `Dashboard Parse Error`, `Dashboard Search Result Skipped`, `Panel Skipped`); one bad panel no longer drops the other panels on its dashboard. A dashboard search response that is not a list is reported as a `Dashboard Search Error` failure, and if Grafana keeps returning the same full page, paging stops with a `Paging Stopped` failure. If stateful ingestion removes stale metadata, a run that skips dashboards is also marked as failed and removes no stale metadata, so that the skipped dashboards are not deleted from DataHub. `skip_text_panels: true` now takes effect; before, text panels were still ingested as charts. **Action:** none. Expect new warnings in the report where these problems were previously silent or stopped ingestion. If you set `skip_text_panels: true`, text-panel charts ingested earlier are removed as stale on the next run with stale-metadata removal on. @@ -684,6 +686,8 @@ Requirements: - [#21116](https://github.com/datahub-project/datahub/pull/21116) **(GMS / Search)** New `siblingGroups` GraphQL query, used by the search "Show siblings" option and the dataset "Composed of" section. It is off by default: set `GRAPHQL_QUERY_MAX_SIBLING_GROUP_URNS` above 0 (the search UI sends up to 30 urns per page) to turn it on. Each request walks up to 1,000 sibling-group members per dataset, and with view authorization on (`VIEW_AUTHORIZATION_ENABLED`) it view-checks every member, so test it on your largest sibling groups before enabling. **Action:** none unless you want the feature. +- **(Ingestion / file source)** The `file` source now turns each `MetadataChangeEvent` it reads into one MCP per aspect, so transformers and sinks receive MCPs only. A `file` sink fed from it writes MCPs, and a custom transformer that handles only MCEs no longer sees these records. The stored aspects are the same. **Action:** none, unless a custom transformer expects MCEs from a file. + - **(Ingestion / REST emitter)** `DatahubRestEmitter` and `DataHubGraph` now send a `MetadataChangeEvent` as one MCP per aspect through `ingestProposal` (or the OpenAPI endpoint with `openapi_ingestion` on) instead of posting it to `/entities?action=ingest`. This also applies to the `datahub-rest` sink in `SYNC` and `ASYNC` mode; the default `ASYNC_BATCH` mode already sent MCPs. The stored aspects are the same, and the `emit_mode` passed to `emit` now applies to MCEs too. An MCE is no longer written all-or-nothing: if GMS rejects one aspect, the aspects before it stay stored, `emit` raises for the rejected one and the rest are not sent. An MCE with no aspects is no longer sent at all. **Action:** none, unless you rely on an MCE being written atomically. - [#21155](https://github.com/datahub-project/datahub/pull/21155) **(Ingestion / datahub-gc)** The soft-deleted entity cleanup no longer hard-deletes a soft-deleted container that still has child entities, including soft-deleted, draft or hidden ones (on a server without the `includeHiddenLifecycleStages` search flag, hidden children are not counted). Hard-deleting it left every child linked to a container that no longer exists (before #20589, it removed the link altogether), so the subtree could not be restored. Such containers now stay soft-deleted, are counted in `num_soft_deleted_containers_retained_with_children`, and are listed in the run report. A subtree that is soft-deleted as a whole is now removed one level per run, children first, so a tree N levels deep takes N runs. **Action:** none. Restore the container to bring its subtree back, or delete its children so a later run can remove it. diff --git a/metadata-ingestion/src/datahub/ingestion/source/file.py b/metadata-ingestion/src/datahub/ingestion/source/file.py index 62949fa2ef86..472727636abb 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/file.py +++ b/metadata-ingestion/src/datahub/ingestion/source/file.py @@ -199,6 +199,7 @@ class GenericFileSource(StatefulIngestionSourceBase, TestableSource): This plugin pulls metadata from a previously generated file. The [metadata file sink](../../../../metadata-ingestion/sink_docs/metadata-file.md) can produce such files, and a number of samples are included in the [examples/mce_files](../../../../metadata-ingestion/examples/mce_files) directory. + MetadataChangeEvents in the file are deprecated; they are read as one MCP per aspect. """ def __init__(self, ctx: PipelineContext, config: FileSourceConfig): @@ -237,6 +238,7 @@ def get_workunits_internal( self, ) -> Iterable[MetadataWorkUnit]: for f in self.get_filenames(): + warned_mce = False for i, obj in self.iterate_generic_file(f): id = f"{f.path}:{i}" if isinstance( @@ -254,7 +256,16 @@ def get_workunits_internal( else: yield MetadataWorkUnit(id, mcp_raw=obj) else: - yield MetadataWorkUnit(id, mce=obj) + if not warned_mce: + warned_mce = True + self.report.warning( + title="MetadataChangeEvents are deprecated", + message="The file contains MetadataChangeEvents. They are converted to MCPs; " + "reading MetadataChangeEvents will be removed in a future release. " + "Rewrite the file as MCPs.", + context=f.path, + ) + yield from MetadataWorkUnit(id, mce=obj).decompose_mce_into_mcps() self.report.total_num_files += 1 self.report.append_total_bytes_on_disk(f.size) diff --git a/metadata-ingestion/tests/integration/remote/golden/remote_file_golden.json b/metadata-ingestion/tests/integration/remote/golden/remote_file_golden.json index ae8c0cf76d49..69e701d38c8e 100644 --- a/metadata-ingestion/tests/integration/remote/golden/remote_file_golden.json +++ b/metadata-ingestion/tests/integration/remote/golden/remote_file_golden.json @@ -1,48 +1,46 @@ [ { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.CorpUserSnapshot": { - "urn": "urn:li:corpuser:harshal", - "aspects": [ - { - "com.linkedin.pegasus2avro.identity.CorpUserInfo": { - "customProperties": {}, - "active": true, - "displayName": "Harshal Sheth", - "email": "harshal@sheth.io", - "title": "Engineer", - "fullName": "Harshal Sheth" - } - } - ] + "entityType": "corpuser", + "entityUrn": "urn:li:corpuser:harshal", + "changeType": "UPSERT", + "aspectName": "corpUserInfo", + "aspect": { + "json": { + "customProperties": {}, + "active": true, + "displayName": "Harshal Sheth", + "email": "harshal@sheth.io", + "title": "Engineer", + "fullName": "Harshal Sheth", + "system": false } }, "systemMetadata": { "lastObserved": 1629795600000, - "runId": "remote-2" + "runId": "remote-2", + "lastRunId": "no-run-id-provided" } }, { - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.CorpUserSnapshot": { - "urn": "urn:li:corpuser:jane", - "aspects": [ - { - "com.linkedin.pegasus2avro.identity.CorpUserInfo": { - "customProperties": {}, - "active": true, - "displayName": "Jane Doe", - "email": "jane@example.com", - "title": "CEO", - "fullName": "Jane Doe" - } - } - ] + "entityType": "corpuser", + "entityUrn": "urn:li:corpuser:jane", + "changeType": "UPSERT", + "aspectName": "corpUserInfo", + "aspect": { + "json": { + "customProperties": {}, + "active": true, + "displayName": "Jane Doe", + "email": "jane@example.com", + "title": "CEO", + "fullName": "Jane Doe", + "system": false } }, "systemMetadata": { "lastObserved": 1629795600000, - "runId": "remote-2" + "runId": "remote-2", + "lastRunId": "no-run-id-provided" } } ] \ No newline at end of file diff --git a/metadata-ingestion/tests/unit/serde/test_serde.py b/metadata-ingestion/tests/unit/serde/test_serde.py index dded41f374d2..f0038093b041 100644 --- a/metadata-ingestion/tests/unit/serde/test_serde.py +++ b/metadata-ingestion/tests/unit/serde/test_serde.py @@ -13,7 +13,9 @@ from datahub.cli.json_file import check_mce_file from datahub.emitter import mce_builder from datahub.emitter.mcp import MetadataChangeProposalWrapper +from datahub.emitter.mcp_builder import mcps_from_mce from datahub.emitter.serialization_helper import post_json_transform, pre_json_transform +from datahub.ingestion.api.common import PipelineContext from datahub.ingestion.run.pipeline import Pipeline from datahub.ingestion.source.file import ( FileSourceConfig, @@ -65,9 +67,30 @@ def test_serde_to_json( pytestconfig, output_path=f"{output_file}", golden_path=golden_file, + golden_mces_as_mcps=True, + fail_on_output_mces=True, ) +def test_file_source_converts_mces_to_mcps(pytestconfig: pytest.Config) -> None: + json_path = pytestconfig.rootpath / "tests/unit/serde/test_serde_large.json" + source = GenericFileSource( + ctx=PipelineContext(run_id="file-source-mce"), + config=FileSourceConfig(path=str(json_path)), + ) + expected = [ + mcp + for mce in read_metadata_file(json_path) + if isinstance(mce, MetadataChangeEventClass) + for mcp in mcps_from_mce(mce) + ] + + workunits = list(source.get_workunits_internal()) + + assert [wu.metadata for wu in workunits] == expected + assert len(source.report.warnings) == 1 + + @pytest.mark.parametrize( "json_filename", [ From 2f8356afdde169df44030988241712d0628c1e43 Mon Sep 17 00:00:00 2001 From: avi <252974426+aviraj-gour@users.noreply.github.com> Date: Tue, 17 Nov 2026 10:38:23 +0530 Subject: [PATCH 08/20] fix(ingest/file): report MCEs without aspects and correct MCE docs The file source reports an MCE with no aspects as a failure instead of dropping it, as the extractor did before MCEs were split in the source. Mark --unpack-mces as having no effect, complete the breaking-changes entries (PR links, check metadata-file, emit mode default, ASYNC sink errors), fix stale comments and docs, and tighten the file-source and REST emitter tests. --- docs/how/breaking-changes.md | 8 +-- .../docs/transformer/dataset_transformer.md | 2 +- .../docs/transformer/set_attribution.md | 2 +- metadata-ingestion/sink_docs/metadata-file.md | 2 +- .../src/datahub/cli/check_cli.py | 5 +- .../src/datahub/cli/json_file.py | 2 +- .../api/incremental_ownership_helper.py | 7 +-- .../src/datahub/ingestion/source/file.py | 4 ++ .../datahub/ingestion/source/sql/vertica.py | 18 +------ .../source/sqlmesh/sqlmesh_source.py | 1 - .../tests/unit/sdk/test_rest_emitter.py | 53 +++---------------- .../tests/unit/serde/test_serde.py | 42 ++++++++++++--- 12 files changed, 64 insertions(+), 82 deletions(-) diff --git a/docs/how/breaking-changes.md b/docs/how/breaking-changes.md index 41bdc4325c3e..0c70b1ea1038 100644 --- a/docs/how/breaking-changes.md +++ b/docs/how/breaking-changes.md @@ -660,9 +660,9 @@ Requirements: - [#20962](https://github.com/datahub-project/datahub/pull/20962) **(Ingestion / Kafka emitter, Airflow)** Emitting a `MetadataChangeEvent` with `DatahubKafkaEmitter` (`emit` or `emit_mce_async`) is deprecated. **Action:** emit `MetadataChangeProposalWrapper` instead. -- **(Ingestion / REST emitter)** Emitting a `MetadataChangeEvent` with `DatahubRestEmitter` or `DataHubGraph` (`emit` or `emit_mce`) is deprecated and will be removed in a future release. **Action:** emit `MetadataChangeProposalWrapper` instead. +- [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / REST emitter)** Emitting a `MetadataChangeEvent` with `DatahubRestEmitter` or `DataHubGraph` (`emit` or `emit_mce`) is deprecated and will be removed in a future release. **Action:** emit `MetadataChangeProposalWrapper` instead. -- **(Ingestion / file source)** Reading `MetadataChangeEvent` records with the `file` source is deprecated and will be removed in a future release. The run report shows a warning for each file that contains them. **Action:** rewrite the file as MCPs, for example by running it through the `file` source into the `file` sink. +- [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / file source)** Reading `MetadataChangeEvent` records with the `file` source is deprecated and will be removed in a future release. The run report shows a warning for each file that contains them. **Action:** rewrite the file as MCPs, for example by running it through the `file` source into the `file` sink. ### Other Notable Changes @@ -688,7 +688,9 @@ Requirements: - **(Ingestion / file source)** The `file` source now turns each `MetadataChangeEvent` it reads into one MCP per aspect, so transformers and sinks receive MCPs only. A `file` sink fed from it writes MCPs, and a custom transformer that handles only MCEs no longer sees these records. The stored aspects are the same. **Action:** none, unless a custom transformer expects MCEs from a file. -- **(Ingestion / REST emitter)** `DatahubRestEmitter` and `DataHubGraph` now send a `MetadataChangeEvent` as one MCP per aspect through `ingestProposal` (or the OpenAPI endpoint with `openapi_ingestion` on) instead of posting it to `/entities?action=ingest`. This also applies to the `datahub-rest` sink in `SYNC` and `ASYNC` mode; the default `ASYNC_BATCH` mode already sent MCPs. The stored aspects are the same, and the `emit_mode` passed to `emit` now applies to MCEs too. An MCE is no longer written all-or-nothing: if GMS rejects one aspect, the aspects before it stay stored, `emit` raises for the rejected one and the rest are not sent. An MCE with no aspects is no longer sent at all. **Action:** none, unless you rely on an MCE being written atomically. +- [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / file source)** The `file` source now turns each `MetadataChangeEvent` it reads into one MCP per aspect, so transformers and sinks receive MCPs only. A `file` sink fed from it writes MCPs, and a custom transformer that handles only MCEs no longer sees these records. `datahub check metadata-file --rewrite` therefore rewrites an MCE file as MCPs, and its `--unpack-mces` flag has no effect. The stored aspects are the same. **Action:** none, unless a custom transformer expects MCEs from a file. + +- [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / REST emitter)** `DatahubRestEmitter` and `DataHubGraph` now send a `MetadataChangeEvent` as one MCP per aspect, through the same endpoint the emitter uses for MCPs, instead of posting it to `/entities?action=ingest`. This also applies to the `datahub-rest` sink in `SYNC` and `ASYNC` mode; the default `ASYNC_BATCH` mode already sent MCPs. The stored aspects are the same. MCEs now follow the emit mode like MCPs do: `emit_mce`, and `emit` without `emit_mode`, use the emitter's `default_emit_mode` or the `DATAHUB_EMIT_MODE` environment variable (default `SYNC_PRIMARY`) instead of always writing synchronously. In the sink's `ASYNC` mode, GMS writes MCE aspects asynchronously, so a validation or database error for them no longer shows in the run report. An MCE is no longer written all-or-nothing: if GMS rejects one aspect, the aspects before it stay stored, `emit` raises for the rejected one and the rest are not sent. An MCE with no aspects is no longer sent at all. **Action:** none, unless you rely on an MCE being written atomically. - [#21155](https://github.com/datahub-project/datahub/pull/21155) **(Ingestion / datahub-gc)** The soft-deleted entity cleanup no longer hard-deletes a soft-deleted container that still has child entities, including soft-deleted, draft or hidden ones (on a server without the `includeHiddenLifecycleStages` search flag, hidden children are not counted). Hard-deleting it left every child linked to a container that no longer exists (before #20589, it removed the link altogether), so the subtree could not be restored. Such containers now stay soft-deleted, are counted in `num_soft_deleted_containers_retained_with_children`, and are listed in the run report. A subtree that is soft-deleted as a whole is now removed one level per run, children first, so a tree N levels deep takes N runs. **Action:** none. Restore the container to bring its subtree back, or delete its children so a later run can remove it. diff --git a/metadata-ingestion/docs/transformer/dataset_transformer.md b/metadata-ingestion/docs/transformer/dataset_transformer.md index d29913a2afa1..ed3b02b5a8df 100644 --- a/metadata-ingestion/docs/transformer/dataset_transformer.md +++ b/metadata-ingestion/docs/transformer/dataset_transformer.md @@ -1875,7 +1875,7 @@ transformers: owners_json: "" # the JSON file mentioned at the start ``` -After running `datahub ingest -c `, our MCEs will now have the following owners appended: +After running `datahub ingest -c `, the `ownership` aspect of each dataset will now have the following owners appended: ```json "owners": [ diff --git a/metadata-ingestion/docs/transformer/set_attribution.md b/metadata-ingestion/docs/transformer/set_attribution.md index 69b46029e1c5..d01c57213716 100644 --- a/metadata-ingestion/docs/transformer/set_attribution.md +++ b/metadata-ingestion/docs/transformer/set_attribution.md @@ -22,7 +22,7 @@ This transformer applies to every entity type. Aspects other than the three abov :::warning Sources that emit MCEs lose their other aspects -For a `MetadataChangeEvent` (MCE), only the three aspects above are forwarded and its other aspects are dropped. To check what a source emits, run it into a `file` sink. +For a `MetadataChangeEvent` (MCE) that carries one of the three aspects above, only those aspects are forwarded and its other aspects are dropped. To check what a source emits, run it into a `file` sink. ::: ## Config Details diff --git a/metadata-ingestion/sink_docs/metadata-file.md b/metadata-ingestion/sink_docs/metadata-file.md index 2fa54d9ad3a6..c61a0aa1d868 100644 --- a/metadata-ingestion/sink_docs/metadata-file.md +++ b/metadata-ingestion/sink_docs/metadata-file.md @@ -29,7 +29,7 @@ source: sink: type: file config: - filename: ./path/to/mce/file.json + filename: ./path/to/metadata/file.json ``` ## Config details diff --git a/metadata-ingestion/src/datahub/cli/check_cli.py b/metadata-ingestion/src/datahub/cli/check_cli.py index 2fd11ddc4b7c..cfaa78f6427c 100644 --- a/metadata-ingestion/src/datahub/cli/check_cli.py +++ b/metadata-ingestion/src/datahub/cli/check_cli.py @@ -46,7 +46,10 @@ def check() -> None: help="Rewrite the JSON file to it's canonical form.", ) @click.option( - "--unpack-mces", default=False, is_flag=True, help="Converts MCEs into MCPs" + "--unpack-mces", + default=False, + is_flag=True, + help="Deprecated and has no effect: MCEs are always converted into MCPs.", ) def metadata_file(json_file: str, rewrite: bool, unpack_mces: bool) -> None: """Check the schema of a metadata (MCE or MCP) JSON file.""" diff --git a/metadata-ingestion/src/datahub/cli/json_file.py b/metadata-ingestion/src/datahub/cli/json_file.py index c55b5f64ef3c..e45ef9a77ceb 100644 --- a/metadata-ingestion/src/datahub/cli/json_file.py +++ b/metadata-ingestion/src/datahub/cli/json_file.py @@ -23,4 +23,4 @@ def check_mce_file(filepath: str) -> str: f"Failed to process file due to {mce_source.get_report().failures}" ) else: - return f"{mce_source.get_report().events_produced} records found - all valid" + return f"{mce_source.get_report().events_produced} MCPs found - all valid" diff --git a/metadata-ingestion/src/datahub/ingestion/api/incremental_ownership_helper.py b/metadata-ingestion/src/datahub/ingestion/api/incremental_ownership_helper.py index bb557937d77b..e57ea047b04b 100644 --- a/metadata-ingestion/src/datahub/ingestion/api/incremental_ownership_helper.py +++ b/metadata-ingestion/src/datahub/ingestion/api/incremental_ownership_helper.py @@ -6,9 +6,10 @@ types (datasets, containers, charts, dashboards, glossary terms, ML models, …). The patch path uses ``create_dataset_owners_patch_builder`` → ``DatasetPatchBuilder``, which is dataset-specific. We therefore filter - explicitly by ``entityType == "dataset"``; non-dataset ownership passes - through as UPSERT. Compare ``auto_incremental_lineage``, which dispatches - across dataset/chart/dashboard patch builders for the same reason. + explicitly by dataset URN (MCE) / ``entityType == "dataset"`` (MCPW); + non-dataset ownership passes through as UPSERT. Compare + ``auto_incremental_lineage``, which dispatches across + dataset/chart/dashboard patch builders for the same reason. 2. Empty owners are dropped silently. ``create_dataset_owners_patch_builder`` emits one patch op per owner, so an empty ``owners`` list yields zero ops diff --git a/metadata-ingestion/src/datahub/ingestion/source/file.py b/metadata-ingestion/src/datahub/ingestion/source/file.py index 472727636abb..5adbf873d42b 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/file.py +++ b/metadata-ingestion/src/datahub/ingestion/source/file.py @@ -255,6 +255,10 @@ def get_workunits_internal( yield MetadataWorkUnit(id, mcp=obj) else: yield MetadataWorkUnit(id, mcp_raw=obj) + elif not obj.proposedSnapshot.aspects: + self.report.failure( + message="MetadataChangeEvent has no aspects", context=id + ) else: if not warned_mce: warned_mce = True diff --git a/metadata-ingestion/src/datahub/ingestion/source/sql/vertica.py b/metadata-ingestion/src/datahub/ingestion/source/sql/vertica.py index 90d2c5b64225..76a8759f3b19 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sql/vertica.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sql/vertica.py @@ -355,23 +355,7 @@ def _process_view( view: str, sql_config: SQLCommonConfig, ) -> Iterable[MetadataWorkUnit]: - """ - This function is used for performing operation and gets data for every view inside a schema - - Args: - dataset_name (str) - inspector (Inspector) - schema (str): schema name - view (str): name of the view to inspect - sql_config (SQLCommonConfig) - table_tags (Dict[str, str], optional) Defaults to dict(). - - Returns: - Iterable[MetadataWorkUnit] - - Yields: - Iterator[Iterable[MetadataWorkUnit]] - """ + """Yield the work units for one view in a schema.""" dataset_urn = make_dataset_urn_with_platform_instance( self.platform, diff --git a/metadata-ingestion/src/datahub/ingestion/source/sqlmesh/sqlmesh_source.py b/metadata-ingestion/src/datahub/ingestion/source/sqlmesh/sqlmesh_source.py index f5c097324dc5..f2bc608d9222 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sqlmesh/sqlmesh_source.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sqlmesh/sqlmesh_source.py @@ -578,7 +578,6 @@ def _emit_model( # Emit status FIRST so the MAE consumer can always hydrate the entity, # even if it processes this MCL before other aspects are committed. - # dbt uses the same pattern (StatusClass emitted before the other aspects). yield MetadataChangeProposalWrapper( entityUrn=sqlmesh_urn, aspect=StatusClass(removed=False), diff --git a/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py b/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py index 04bb27e90470..1ef24fcc717d 100644 --- a/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py +++ b/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py @@ -3096,34 +3096,6 @@ def mce_emitter() -> DataHubRestEmitter: ) -def test_emit_mce_emits_one_mcp_per_aspect(mce_emitter: DataHubRestEmitter) -> None: - status = Status(removed=False) - properties = DatasetProperties(description="d") - mce = MetadataChangeEventClass( - proposedSnapshot=DatasetSnapshotClass( - urn=_MCE_URN, aspects=[status, properties] - ) - ) - callback = Mock() - - with ( - patch.object(mce_emitter, "emit_mcp") as emit_mcp, - pytest.warns(DataHubDeprecationWarning), - ): - mce_emitter.emit(mce, callback=callback, emit_mode=EmitMode.SYNC_WAIT) - - mcps = [c.args[0] for c in emit_mcp.call_args_list] - assert all(isinstance(m, MetadataChangeProposalWrapper) for m in mcps) - assert [(m.entityUrn, m.aspect) for m in mcps] == [ - (_MCE_URN, status), - (_MCE_URN, properties), - ] - assert [c.kwargs["emit_mode"] for c in emit_mcp.call_args_list] == [ - EmitMode.SYNC_WAIT - ] * 2 - callback.assert_called_once_with(None, "success") - - def test_emit_mce_method_is_deprecated_and_uses_default_emit_mode( mce_emitter: DataHubRestEmitter, ) -> None: @@ -3153,37 +3125,24 @@ def test_emit_mce_posts_to_ingest_proposal(mce_emitter: DataHubRestEmitter) -> N response = Mock(spec=Response) response.status_code = 200 response.headers = {} + callback = Mock() with ( patch.object( mce_emitter, "_emit_generic", return_value=response ) as emit_generic, pytest.warns(DataHubDeprecationWarning), ): - mce_emitter.emit(mce) + mce_emitter.emit(mce, callback=callback, emit_mode=EmitMode.SYNC_PRIMARY) urls = [c.args[0] for c in emit_generic.call_args_list] assert urls == [f"{MOCK_GMS_ENDPOINT}/aspects?action=ingestProposal"] * 2 - proposals = [json.loads(c.args[1])["proposal"] for c in emit_generic.call_args_list] + payloads = [json.loads(c.args[1]) for c in emit_generic.call_args_list] + proposals = [p["proposal"] for p in payloads] assert [p["aspectName"] for p in proposals] == ["status", "datasetProperties"] assert [p["systemMetadata"]["runId"] for p in proposals] == ["run-1"] * 2 - - -def test_emit_mce_with_no_aspects_emits_nothing( - mce_emitter: DataHubRestEmitter, caplog: pytest.LogCaptureFixture -) -> None: - mce = MetadataChangeEventClass( - proposedSnapshot=DatasetSnapshotClass(urn=_MCE_URN, aspects=[]) - ) - callback = Mock() - with ( - patch.object(mce_emitter, "_emit_generic") as emit_generic, - pytest.warns(DataHubDeprecationWarning), - ): - mce_emitter.emit(mce, callback=callback) - - emit_generic.assert_not_called() + # The fixture's default is ASYNC, so "false" shows the explicit emit_mode won. + assert [p["async"] for p in payloads] == ["false"] * 2 callback.assert_called_once_with(None, "success") - assert "produced zero MCPs" in caplog.text def test_emit_mce_failure_stops_and_reaches_callback( diff --git a/metadata-ingestion/tests/unit/serde/test_serde.py b/metadata-ingestion/tests/unit/serde/test_serde.py index f0038093b041..981cd9f14c38 100644 --- a/metadata-ingestion/tests/unit/serde/test_serde.py +++ b/metadata-ingestion/tests/unit/serde/test_serde.py @@ -17,6 +17,7 @@ from datahub.emitter.serialization_helper import post_json_transform, pre_json_transform from datahub.ingestion.api.common import PipelineContext from datahub.ingestion.run.pipeline import Pipeline +from datahub.ingestion.sink.file import write_metadata_file from datahub.ingestion.source.file import ( FileSourceConfig, GenericFileSource, @@ -72,23 +73,52 @@ def test_serde_to_json( ) -def test_file_source_converts_mces_to_mcps(pytestconfig: pytest.Config) -> None: - json_path = pytestconfig.rootpath / "tests/unit/serde/test_serde_large.json" +def test_file_source_converts_mces_to_mcps( + pytestconfig: pytest.Config, tmp_path: pathlib.Path +) -> None: + serde_dir = pytestconfig.rootpath / "tests/unit/serde" + mce_file = tmp_path / "mces.json" + shutil.copy(serde_dir / "test_serde_large.json", mce_file) + shutil.copy(serde_dir / "test_serde_patch.json", tmp_path / "mcps.json") source = GenericFileSource( ctx=PipelineContext(run_id="file-source-mce"), - config=FileSourceConfig(path=str(json_path)), + config=FileSourceConfig(path=str(tmp_path)), ) expected = [ mcp - for mce in read_metadata_file(json_path) + for mce in read_metadata_file(mce_file) if isinstance(mce, MetadataChangeEventClass) for mcp in mcps_from_mce(mce) ] workunits = list(source.get_workunits_internal()) - assert [wu.metadata for wu in workunits] == expected - assert len(source.report.warnings) == 1 + assert [ + wu.metadata for wu in workunits if wu.id.startswith(str(mce_file)) + ] == expected + # One warning, naming only the file that holds MCEs. + assert [list(w.context) for w in source.report.warnings] == [[str(mce_file)]] + + +def test_file_source_reports_mce_without_aspects(tmp_path: pathlib.Path) -> None: + json_path = tmp_path / "empty_mce.json" + write_metadata_file( + json_path, + [ + MetadataChangeEventClass( + proposedSnapshot=models.DatasetSnapshotClass( + urn=mce_builder.make_dataset_urn("hive", "db.table"), aspects=[] + ) + ) + ], + ) + source = GenericFileSource( + ctx=PipelineContext(run_id="file-source-empty-mce"), + config=FileSourceConfig(path=str(json_path)), + ) + + assert list(source.get_workunits_internal()) == [] + assert len(source.report.failures) == 1 @pytest.mark.parametrize( From edbdde6867854cee6cb8c6341063b911235cb5fc Mon Sep 17 00:00:00 2001 From: avi <252974426+aviraj-gour@users.noreply.github.com> Date: Tue, 17 Nov 2026 16:02:56 +0530 Subject: [PATCH 09/20] fix(ingest): send an MCE's aspects as one batch from the REST emitter The REST emitter sent each aspect of an MCE as its own request, so GMS stamped them at different times and the timeline showed one change per aspect instead of one per MCE. emit(mce) and emit_mce now send the MCE's MCPs in one emit_mcps batch, as the old /entities?action=ingest call did. Inside an ingestion pipeline MCEs stay individual MCPs and the sink mode decides batching; breaking-changes.md notes the per-aspect timeline in the sink's SYNC and ASYNC modes. The timeline smoke test now uses MCP fixtures and writes each dataset version in one synchronous emit_mcps batch, keeping its assertions. --- docs/how/breaking-changes.md | 2 +- .../src/datahub/emitter/rest_emitter.py | 6 +- .../tests/unit/sdk/test_rest_emitter.py | 30 +- .../tests/unit/test_rest_sink.py | 120 ++++---- .../tests/e2e/timeline/timeline_test.py | 25 +- .../e2e/timeline/timeline_test_data.json | 227 ++++++++------- .../e2e/timeline/timeline_test_datav2.json | 266 +++++++++--------- .../e2e/timeline/timeline_test_datav3.json | 239 ++++++++-------- 8 files changed, 480 insertions(+), 435 deletions(-) diff --git a/docs/how/breaking-changes.md b/docs/how/breaking-changes.md index 0c70b1ea1038..a0a8524a7c87 100644 --- a/docs/how/breaking-changes.md +++ b/docs/how/breaking-changes.md @@ -690,7 +690,7 @@ Requirements: - [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / file source)** The `file` source now turns each `MetadataChangeEvent` it reads into one MCP per aspect, so transformers and sinks receive MCPs only. A `file` sink fed from it writes MCPs, and a custom transformer that handles only MCEs no longer sees these records. `datahub check metadata-file --rewrite` therefore rewrites an MCE file as MCPs, and its `--unpack-mces` flag has no effect. The stored aspects are the same. **Action:** none, unless a custom transformer expects MCEs from a file. -- [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / REST emitter)** `DatahubRestEmitter` and `DataHubGraph` now send a `MetadataChangeEvent` as one MCP per aspect, through the same endpoint the emitter uses for MCPs, instead of posting it to `/entities?action=ingest`. This also applies to the `datahub-rest` sink in `SYNC` and `ASYNC` mode; the default `ASYNC_BATCH` mode already sent MCPs. The stored aspects are the same. MCEs now follow the emit mode like MCPs do: `emit_mce`, and `emit` without `emit_mode`, use the emitter's `default_emit_mode` or the `DATAHUB_EMIT_MODE` environment variable (default `SYNC_PRIMARY`) instead of always writing synchronously. In the sink's `ASYNC` mode, GMS writes MCE aspects asynchronously, so a validation or database error for them no longer shows in the run report. An MCE is no longer written all-or-nothing: if GMS rejects one aspect, the aspects before it stay stored, `emit` raises for the rejected one and the rest are not sent. An MCE with no aspects is no longer sent at all. **Action:** none, unless you rely on an MCE being written atomically. +- [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / REST emitter)** `DatahubRestEmitter` and `DataHubGraph` now send a `MetadataChangeEvent` as its MCPs in one batch request, through the same endpoint the emitter uses for MCP batches, instead of posting it to `/entities?action=ingest`. The `datahub-rest` sink in `SYNC` and `ASYNC` mode sends an MCE as one MCP request per aspect, so its timeline shows one change per aspect instead of one per MCE; the default `ASYNC_BATCH` mode already sent MCPs. The stored aspects are the same. MCEs now follow the emit mode like MCPs do: `emit_mce`, and `emit` without `emit_mode`, use the emitter's `default_emit_mode` or the `DATAHUB_EMIT_MODE` environment variable (default `SYNC_PRIMARY`) instead of always writing synchronously. In the sink's `ASYNC` mode, GMS writes MCE aspects asynchronously, so a validation or database error for them no longer shows in the run report. An MCE is no longer written all-or-nothing: in the sink's `SYNC` and `ASYNC` modes, if GMS rejects one aspect, the aspects before it stay stored and the rest are not sent. An MCE with no aspects is no longer sent at all. **Action:** none, unless you rely on an MCE being written atomically. - [#21155](https://github.com/datahub-project/datahub/pull/21155) **(Ingestion / datahub-gc)** The soft-deleted entity cleanup no longer hard-deletes a soft-deleted container that still has child entities, including soft-deleted, draft or hidden ones (on a server without the `includeHiddenLifecycleStages` search flag, hidden children are not counted). Hard-deleting it left every child linked to a container that no longer exists (before #20589, it removed the link altogether), so the subtree could not be restored. Such containers now stay soft-deleted, are counted in `num_soft_deleted_containers_retained_with_children`, and are listed in the run report. A subtree that is soft-deleted as a whole is now removed one level per run, children first, so a tree N levels deep takes N runs. **Action:** none. Restore the container to bring its subtree back, or delete its children so a later run can remove it. diff --git a/metadata-ingestion/src/datahub/emitter/rest_emitter.py b/metadata-ingestion/src/datahub/emitter/rest_emitter.py index 6f3dbe32f3f0..6d591311372a 100644 --- a/metadata-ingestion/src/datahub/emitter/rest_emitter.py +++ b/metadata-ingestion/src/datahub/emitter/rest_emitter.py @@ -859,7 +859,7 @@ def emit_mce(self, mce: MetadataChangeEvent) -> None: self._emit_mce(mce, self._default_emit_mode) def _emit_mce(self, mce: MetadataChangeEvent, emit_mode: EmitMode) -> None: - """Not atomic: if emitting aspect k raises, the aspects before it were already sent and the rest are not.""" + """Sends the MCE's aspects in one batch so GMS stamps them as one change; oversized MCEs are split across requests.""" # Deferred to break the cycle mcp_builder -> ingestion.api.common -> graph.client -> rest_emitter. from datahub.emitter.mcp_builder import mcps_from_mce @@ -867,8 +867,8 @@ def _emit_mce(self, mce: MetadataChangeEvent, emit_mode: EmitMode) -> None: mcps = list(mcps_from_mce(mce)) if not mcps: logger.warning(f"MCE for {mce.proposedSnapshot.urn} produced zero MCPs") - for mcp in mcps: - self.emit_mcp(mcp, emit_mode=emit_mode) + return + self.emit_mcps(mcps, emit_mode=emit_mode) @overload @deprecated("Use emit_mode instead of async_flag") diff --git a/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py b/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py index 1ef24fcc717d..0d66ba666e2e 100644 --- a/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py +++ b/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py @@ -3105,16 +3105,18 @@ def test_emit_mce_method_is_deprecated_and_uses_default_emit_mode( ) ) with ( - patch.object(mce_emitter, "emit_mcp") as emit_mcp, + patch.object(mce_emitter, "emit_mcps") as emit_mcps, pytest.warns(DataHubDeprecationWarning), ): mce_emitter.emit_mce(mce) - emit_mcp.assert_called_once() - assert emit_mcp.call_args.kwargs["emit_mode"] == EmitMode.ASYNC + emit_mcps.assert_called_once() + assert emit_mcps.call_args.kwargs["emit_mode"] == EmitMode.ASYNC -def test_emit_mce_posts_to_ingest_proposal(mce_emitter: DataHubRestEmitter) -> None: +def test_emit_mce_posts_one_ingest_proposal_batch( + mce_emitter: DataHubRestEmitter, +) -> None: mce = MetadataChangeEventClass( proposedSnapshot=DatasetSnapshotClass( urn=_MCE_URN, @@ -3134,18 +3136,20 @@ def test_emit_mce_posts_to_ingest_proposal(mce_emitter: DataHubRestEmitter) -> N ): mce_emitter.emit(mce, callback=callback, emit_mode=EmitMode.SYNC_PRIMARY) - urls = [c.args[0] for c in emit_generic.call_args_list] - assert urls == [f"{MOCK_GMS_ENDPOINT}/aspects?action=ingestProposal"] * 2 - payloads = [json.loads(c.args[1]) for c in emit_generic.call_args_list] - proposals = [p["proposal"] for p in payloads] + # One request, so GMS stamps every aspect with the same time (one timeline change). + emit_generic.assert_called_once() + url, body = emit_generic.call_args.args + assert url == f"{MOCK_GMS_ENDPOINT}/aspects?action=ingestProposalBatch" + payload = json.loads(body) + proposals = payload["proposals"] assert [p["aspectName"] for p in proposals] == ["status", "datasetProperties"] assert [p["systemMetadata"]["runId"] for p in proposals] == ["run-1"] * 2 # The fixture's default is ASYNC, so "false" shows the explicit emit_mode won. - assert [p["async"] for p in payloads] == ["false"] * 2 + assert payload["async"] == "false" callback.assert_called_once_with(None, "success") -def test_emit_mce_failure_stops_and_reaches_callback( +def test_emit_mce_failure_reaches_callback( mce_emitter: DataHubRestEmitter, ) -> None: mce = MetadataChangeEventClass( @@ -3157,13 +3161,13 @@ def test_emit_mce_failure_stops_and_reaches_callback( error = OperationalError("rejected") callback = Mock() with ( - patch.object(mce_emitter, "emit_mcp", side_effect=error) as emit_mcp, + patch.object(mce_emitter, "emit_mcps", side_effect=error) as emit_mcps, pytest.warns(DataHubDeprecationWarning), pytest.raises(OperationalError), ): mce_emitter.emit(mce, callback=callback) - emit_mcp.assert_called_once() + emit_mcps.assert_called_once() callback.assert_called_once_with(error, str(error)) @@ -3176,7 +3180,7 @@ def test_mce_deprecation_logged_once_per_process( ) ) with ( - patch.object(mce_emitter, "emit_mcp"), + patch.object(mce_emitter, "emit_mcps"), pytest.warns(DataHubDeprecationWarning), ): mce_emitter.emit(mce) diff --git a/metadata-ingestion/tests/unit/test_rest_sink.py b/metadata-ingestion/tests/unit/test_rest_sink.py index 42968b063046..188079f3040d 100644 --- a/metadata-ingestion/tests/unit/test_rest_sink.py +++ b/metadata-ingestion/tests/unit/test_rest_sink.py @@ -55,28 +55,30 @@ ], ), ), - "/aspects?action=ingestProposal", + "/aspects?action=ingestProposalBatch", { "async": "false", - "proposal": { - "entityType": "dataset", - "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:bigquery,downstream,PROD)", - "changeType": "UPSERT", - "aspectName": "upstreamLineage", - "aspect": { - "value": '{"upstreams": [{"auditStamp": {"time": 1618987484580, "actor": "urn:li:corpuser:datahub"}, "dataset": "urn:li:dataset:(urn:li:dataPlatform:bigquery,upstream1,PROD)", "type": "TRANSFORMED"}, {"auditStamp": {"time": 1618987484580, "actor": "urn:li:corpuser:datahub"}, "dataset": "urn:li:dataset:(urn:li:dataPlatform:bigquery,upstream2,PROD)", "type": "TRANSFORMED"}]}', - "contentType": "application/json", - }, - "systemMetadata": { - "lastObserved": FROZEN_TIME, - "lastRunId": "no-run-id-provided", - "properties": { - "clientId": "acryl-datahub", - "clientVersion": "1!0.0.0.dev0", + "proposals": [ + { + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:bigquery,downstream,PROD)", + "changeType": "UPSERT", + "aspectName": "upstreamLineage", + "aspect": { + "value": '{"upstreams": [{"auditStamp": {"time": 1618987484580, "actor": "urn:li:corpuser:datahub"}, "dataset": "urn:li:dataset:(urn:li:dataPlatform:bigquery,upstream1,PROD)", "type": "TRANSFORMED"}, {"auditStamp": {"time": 1618987484580, "actor": "urn:li:corpuser:datahub"}, "dataset": "urn:li:dataset:(urn:li:dataPlatform:bigquery,upstream2,PROD)", "type": "TRANSFORMED"}]}', + "contentType": "application/json", }, - "runId": "no-run-id-provided", - }, - }, + "systemMetadata": { + "lastObserved": FROZEN_TIME, + "lastRunId": "no-run-id-provided", + "properties": { + "clientId": "acryl-datahub", + "clientVersion": "1!0.0.0.dev0", + }, + "runId": "no-run-id-provided", + }, + } + ], }, ), ( @@ -97,28 +99,30 @@ ], ) ), - "/aspects?action=ingestProposal", + "/aspects?action=ingestProposalBatch", { "async": "false", - "proposal": { - "entityType": "chart", - "entityUrn": "urn:li:chart:(superset,227)", - "changeType": "UPSERT", - "aspectName": "chartInfo", - "aspect": { - "value": '{"customProperties": {}, "title": "Weekly Messages", "description": "", "lastModified": {"created": {"time": 1618987484580, "actor": "urn:li:corpuser:datahub"}, "lastModified": {"time": 1618987484580, "actor": "urn:li:corpuser:datahub"}}, "type": "SCATTER"}', - "contentType": "application/json", - }, - "systemMetadata": { - "lastObserved": FROZEN_TIME, - "lastRunId": "no-run-id-provided", - "properties": { - "clientId": "acryl-datahub", - "clientVersion": "1!0.0.0.dev0", + "proposals": [ + { + "entityType": "chart", + "entityUrn": "urn:li:chart:(superset,227)", + "changeType": "UPSERT", + "aspectName": "chartInfo", + "aspect": { + "value": '{"customProperties": {}, "title": "Weekly Messages", "description": "", "lastModified": {"created": {"time": 1618987484580, "actor": "urn:li:corpuser:datahub"}, "lastModified": {"time": 1618987484580, "actor": "urn:li:corpuser:datahub"}}, "type": "SCATTER"}', + "contentType": "application/json", }, - "runId": "no-run-id-provided", - }, - }, + "systemMetadata": { + "lastObserved": FROZEN_TIME, + "lastRunId": "no-run-id-provided", + "properties": { + "clientId": "acryl-datahub", + "clientVersion": "1!0.0.0.dev0", + }, + "runId": "no-run-id-provided", + }, + } + ], }, ), ( @@ -135,28 +139,30 @@ ], ) ), - "/aspects?action=ingestProposal", + "/aspects?action=ingestProposalBatch", { "async": "false", - "proposal": { - "entityType": "dataJob", - "entityUrn": "urn:li:dataJob:(urn:li:dataFlow:(airflow,dag_abc,PROD),task_456)", - "changeType": "UPSERT", - "aspectName": "dataJobInfo", - "aspect": { - "value": '{"customProperties": {}, "name": "User Deletions", "description": "Constructs the fct_users_deleted from logging_events", "type": {"string": "SQL"}}', - "contentType": "application/json", - }, - "systemMetadata": { - "lastObserved": FROZEN_TIME, - "lastRunId": "no-run-id-provided", - "properties": { - "clientId": "acryl-datahub", - "clientVersion": "1!0.0.0.dev0", + "proposals": [ + { + "entityType": "dataJob", + "entityUrn": "urn:li:dataJob:(urn:li:dataFlow:(airflow,dag_abc,PROD),task_456)", + "changeType": "UPSERT", + "aspectName": "dataJobInfo", + "aspect": { + "value": '{"customProperties": {}, "name": "User Deletions", "description": "Constructs the fct_users_deleted from logging_events", "type": {"string": "SQL"}}', + "contentType": "application/json", }, - "runId": "no-run-id-provided", - }, - }, + "systemMetadata": { + "lastObserved": FROZEN_TIME, + "lastRunId": "no-run-id-provided", + "properties": { + "clientId": "acryl-datahub", + "clientVersion": "1!0.0.0.dev0", + }, + "runId": "no-run-id-provided", + }, + } + ], }, ), ( diff --git a/smoke-test/tests/e2e/timeline/timeline_test.py b/smoke-test/tests/e2e/timeline/timeline_test.py index f898f8c068e8..f1c69db61e6c 100644 --- a/smoke-test/tests/e2e/timeline/timeline_test.py +++ b/smoke-test/tests/e2e/timeline/timeline_test.py @@ -1,31 +1,34 @@ import json +import pathlib import pytest from datahub.cli import timeline_cli from datahub.cli.cli_utils import guess_entity_type, post_entity -from tests.e2e.utils import ingest_file_via_rest, wait_for_writes_to_sync +from datahub.emitter.rest_emitter import EmitMode +from datahub.ingestion.source.file import read_metadata_file +from tests.e2e.utils import wait_for_writes_to_sync from utilities.domains import Domain pytestmark = [pytest.mark.no_cypress_suite1, pytest.mark.domain(Domain.CATALOG)] @pytest.mark.p0 -def test_all(auth_session, graph_client): +def test_all(graph_client): platform = "urn:li:dataPlatform:kafka" dataset_name = "test-timeline-sample-kafka" env = "PROD" dataset_urn = f"urn:li:dataset:({platform},{dataset_name},{env})" - ingest_file_via_rest( - auth_session, "tests/e2e/timeline/timeline_test_data.json", mode="ASYNC" - ) - ingest_file_via_rest( - auth_session, "tests/e2e/timeline/timeline_test_datav2.json", mode="ASYNC" - ) - ingest_file_via_rest( - auth_session, "tests/e2e/timeline/timeline_test_datav3.json", mode="ASYNC" - ) + # Each file is one dataset version. The timeline groups aspects written at the same + # time, so each version goes in one synchronous batch to become one timeline change. + for version_file in [ + "timeline_test_data.json", + "timeline_test_datav2.json", + "timeline_test_datav3.json", + ]: + mcps = list(read_metadata_file(pathlib.Path(__file__).parent / version_file)) + graph_client.emit_mcps(mcps, emit_mode=EmitMode.SYNC_PRIMARY) res_data = timeline_cli.get_timeline( dataset_urn, diff --git a/smoke-test/tests/e2e/timeline/timeline_test_data.json b/smoke-test/tests/e2e/timeline/timeline_test_data.json index a11d93e2c51e..2d3237b8c231 100644 --- a/smoke-test/tests/e2e/timeline/timeline_test_data.json +++ b/smoke-test/tests/e2e/timeline/timeline_test_data.json @@ -1,138 +1,137 @@ [ - { - "auditHeader": null, - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DatasetSnapshot": { - "urn": "urn:li:dataset:(urn:li:dataPlatform:kafka,test-timeline-sample-kafka,PROD)", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataset.DatasetProperties": { - "description": null, - "uri": null, - "tags": [], - "customProperties": { +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,test-timeline-sample-kafka,PROD)", + "changeType": "UPSERT", + "aspectName": "datasetProperties", + "aspect": { + "json": { + "customProperties": { "prop1": "fakeprop", "prop2": "yoshi" - } - } - }, - { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ + }, + "tags": [] + } + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,test-timeline-sample-kafka,PROD)", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ { - "owner": "urn:li:corpuser:jdoe", - "type": "DATAOWNER", - "source": null + "owner": "urn:li:corpuser:jdoe", + "type": "DATAOWNER" }, { - "owner": "urn:li:corpuser:datahub", - "type": "DATAOWNER", - "source": null + "owner": "urn:li:corpuser:datahub", + "type": "DATAOWNER" } - ], - "lastModified": { + ], + "ownerTypes": {}, + "lastModified": { "time": 1581407189000, - "actor": "urn:li:corpuser:jdoe", - "impersonator": null - } + "actor": "urn:li:corpuser:jdoe" } - }, - { - "com.linkedin.pegasus2avro.common.InstitutionalMemory": { - "elements": [ + } + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,test-timeline-sample-kafka,PROD)", + "changeType": "UPSERT", + "aspectName": "institutionalMemory", + "aspect": { + "json": { + "elements": [ { - "url": "https://www.linkedin.com", - "description": "Sample doc", - "createStamp": { - "time": 1581407189000, - "actor": "urn:li:corpuser:jdoe", - "impersonator": null - } + "url": "https://www.linkedin.com", + "description": "Sample doc", + "createStamp": { + "time": 1581407189000, + "actor": "urn:li:corpuser:jdoe" + } } - ] - } - }, - { - "com.linkedin.pegasus2avro.schema.SchemaMetadata": { - "schemaName": "SampleKafkaSchema", - "platform": "urn:li:dataPlatform:kafka", - "version": 0, - "created": { + ] + } + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,test-timeline-sample-kafka,PROD)", + "changeType": "UPSERT", + "aspectName": "schemaMetadata", + "aspect": { + "json": { + "schemaName": "SampleKafkaSchema", + "platform": "urn:li:dataPlatform:kafka", + "version": 0, + "created": { "time": 1581407189000, - "actor": "urn:li:corpuser:jdoe", - "impersonator": null - }, - "lastModified": { + "actor": "urn:li:corpuser:jdoe" + }, + "lastModified": { "time": 1581407189000, - "actor": "urn:li:corpuser:jdoe", - "impersonator": null - }, - "deleted": null, - "dataset": null, - "cluster": null, - "hash": "", - "platformSchema": { - "com.linkedin.pegasus2avro.schema.KafkaSchema": { - "documentSchema": "{\"type\":\"record\",\"name\":\"SampleKafkaSchema\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"Sample Kafka dataset\",\"fields\":[{\"name\":\"field_foo\",\"type\":[\"string\"]},{\"name\":\"field_bar\",\"type\":[\"boolean\"]}]}" + "actor": "urn:li:corpuser:jdoe" + }, + "hash": "", + "platformSchema": { + "com.linkedin.schema.KafkaSchema": { + "documentSchema": "{\"type\":\"record\",\"name\":\"SampleKafkaSchema\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"Sample Kafka dataset\",\"fields\":[{\"name\":\"field_foo\",\"type\":[\"string\"]},{\"name\":\"field_bar\",\"type\":[\"boolean\"]}]}" } - }, - "fields": [ + }, + "fields": [ { - "fieldPath": "[version=2.0].[type=boolean].field_foo_2", - "jsonPath": null, - "nullable": false, - "description": { - "string": "Foo field description" - }, - "type": { + "fieldPath": "[version=2.0].[type=boolean].field_foo_2", + "nullable": false, + "description": "Foo field description", "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "varchar(100)", - "globalTags": { - "tags": [{ "tag": "urn:li:tag:NeedsDocumentation" }] - }, - "recursive": false + "type": { + "com.linkedin.schema.BooleanType": {} + } + }, + "nativeDataType": "varchar(100)", + "recursive": false, + "globalTags": { + "tags": [ + { + "tag": "urn:li:tag:NeedsDocumentation" + } + ] + }, + "isPartOfKey": false }, { - "fieldPath": "[version=2.0].[type=boolean].field_bar", - "jsonPath": null, - "nullable": false, - "description": { - "string": "Bar field description" - }, - "type": { + "fieldPath": "[version=2.0].[type=boolean].field_bar", + "nullable": false, + "description": "Bar field description", "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "boolean", - "recursive": false + "type": { + "com.linkedin.schema.BooleanType": {} + } + }, + "nativeDataType": "boolean", + "recursive": false, + "isPartOfKey": false }, { - "fieldPath": "[version=2.0].[key=True].[type=int].id", - "jsonPath": null, - "nullable": false, - "description": { - "string": "Id specifying which partition the message should go to" - }, - "type": { + "fieldPath": "[version=2.0].[key=True].[type=int].id", + "nullable": false, + "description": "Id specifying which partition the message should go to", "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "boolean", - "recursive": false + "type": { + "com.linkedin.schema.BooleanType": {} + } + }, + "nativeDataType": "boolean", + "recursive": false, + "isPartOfKey": false } - ], - "primaryKeys": null, - "foreignKeysSpecs": null - } - } - ] - } - }, - "proposedDelta": null - } + ] + } + } +} ] \ No newline at end of file diff --git a/smoke-test/tests/e2e/timeline/timeline_test_datav2.json b/smoke-test/tests/e2e/timeline/timeline_test_datav2.json index 30279578701b..0c81ae0abb13 100644 --- a/smoke-test/tests/e2e/timeline/timeline_test_datav2.json +++ b/smoke-test/tests/e2e/timeline/timeline_test_datav2.json @@ -1,150 +1,164 @@ [ - { - "auditHeader": null, - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DatasetSnapshot": { - "urn": "urn:li:dataset:(urn:li:dataPlatform:kafka,test-timeline-sample-kafka,PROD)", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataset.DatasetProperties": { - "description": "A description", - "uri": null, - "tags": [], - "customProperties": { +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,test-timeline-sample-kafka,PROD)", + "changeType": "UPSERT", + "aspectName": "datasetProperties", + "aspect": { + "json": { + "customProperties": { "prop1": "fakeprop", "prop2": "yoshi" - } - } - }, - { - "com.linkedin.pegasus2avro.common.GlobalTags": { - "tags": [{ "tag": "urn:li:tag:Legacy" }] - } - }, - { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ + }, + "description": "A description", + "tags": [] + } + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,test-timeline-sample-kafka,PROD)", + "changeType": "UPSERT", + "aspectName": "globalTags", + "aspect": { + "json": { + "tags": [ + { + "tag": "urn:li:tag:Legacy" + } + ] + } + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,test-timeline-sample-kafka,PROD)", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ { - "owner": "urn:li:corpuser:jdoe", - "type": "DATAOWNER", - "source": null + "owner": "urn:li:corpuser:jdoe", + "type": "DATAOWNER" } - ], - "lastModified": { + ], + "ownerTypes": {}, + "lastModified": { "time": 1581407189001, - "actor": "urn:li:corpuser:jdoe", - "impersonator": null - } + "actor": "urn:li:corpuser:jdoe" } - }, - { - "com.linkedin.pegasus2avro.common.InstitutionalMemory": { - "elements": [ + } + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,test-timeline-sample-kafka,PROD)", + "changeType": "UPSERT", + "aspectName": "institutionalMemory", + "aspect": { + "json": { + "elements": [ { - "url": "https://www.linkedin.com", - "description": "Sample doc", - "createStamp": { - "time": 1581407189000, - "actor": "urn:li:corpuser:jdoe", - "impersonator": null - } + "url": "https://www.linkedin.com", + "description": "Sample doc", + "createStamp": { + "time": 1581407189000, + "actor": "urn:li:corpuser:jdoe" + } }, { - "url": "https://www.google.com", - "description": "Google", - "createStamp": { - "time": 1581407189000, - "actor": "urn:li:corpuser:jdoe", - "impersonator": null - } + "url": "https://www.google.com", + "description": "Google", + "createStamp": { + "time": 1581407189000, + "actor": "urn:li:corpuser:jdoe" + } } - ] - } - }, - { - "com.linkedin.pegasus2avro.schema.SchemaMetadata": { - "schemaName": "SampleKafkaSchema", - "platform": "urn:li:dataPlatform:kafka", - "version": 0, - "created": { + ] + } + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,test-timeline-sample-kafka,PROD)", + "changeType": "UPSERT", + "aspectName": "schemaMetadata", + "aspect": { + "json": { + "schemaName": "SampleKafkaSchema", + "platform": "urn:li:dataPlatform:kafka", + "version": 0, + "created": { "time": 1581407189000, - "actor": "urn:li:corpuser:jdoe", - "impersonator": null - }, - "lastModified": { + "actor": "urn:li:corpuser:jdoe" + }, + "lastModified": { "time": 1581407189000, - "actor": "urn:li:corpuser:jdoe", - "impersonator": null - }, - "deleted": null, - "dataset": null, - "cluster": null, - "hash": "", - "platformSchema": { - "com.linkedin.pegasus2avro.schema.KafkaSchema": { - "documentSchema": "{\"type\":\"record\",\"name\":\"SampleKafkaSchema\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"Sample Kafka dataset\",\"fields\":[{\"name\":\"field_foo\",\"type\":[\"string\"]},{\"name\":\"field_bar\",\"type\":[\"boolean\"]}]}" + "actor": "urn:li:corpuser:jdoe" + }, + "hash": "", + "platformSchema": { + "com.linkedin.schema.KafkaSchema": { + "documentSchema": "{\"type\":\"record\",\"name\":\"SampleKafkaSchema\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"Sample Kafka dataset\",\"fields\":[{\"name\":\"field_foo\",\"type\":[\"string\"]},{\"name\":\"field_bar\",\"type\":[\"boolean\"]}]}" } - }, - "fields": [ + }, + "fields": [ { - "fieldPath": "[version=2.0].[type=boolean].field_foo_2", - "jsonPath": null, - "nullable": false, - "description": { - "string": "Foo field description" - }, - "type": { + "fieldPath": "[version=2.0].[type=boolean].field_foo_2", + "nullable": false, + "description": "Foo field description", "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "varchar(100)", - "globalTags": { - "tags": [{ "tag": "urn:li:tag:NeedsDocumentation" }] - }, - "recursive": false + "type": { + "com.linkedin.schema.BooleanType": {} + } + }, + "nativeDataType": "varchar(100)", + "recursive": false, + "globalTags": { + "tags": [ + { + "tag": "urn:li:tag:NeedsDocumentation" + } + ] + }, + "isPartOfKey": false }, { - "fieldPath": "[version=2.0].[type=boolean].field_foo_3", - "jsonPath": null, - "nullable": false, - "description": { - "string": "Foo field description" - }, - "type": { + "fieldPath": "[version=2.0].[type=boolean].field_foo_3", + "nullable": false, + "description": "Foo field description", "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "varchar(100)", - "globalTags": { - "tags": [{ "tag": "urn:li:tag:NeedsDocumentation" }] - }, - "recursive": false + "type": { + "com.linkedin.schema.BooleanType": {} + } + }, + "nativeDataType": "varchar(100)", + "recursive": false, + "globalTags": { + "tags": [ + { + "tag": "urn:li:tag:NeedsDocumentation" + } + ] + }, + "isPartOfKey": false }, { - "fieldPath": "[version=2.0].[type=boolean].field_bar", - "jsonPath": null, - "nullable": false, - "description": { - "string": "Bar field description" - }, - "type": { + "fieldPath": "[version=2.0].[type=boolean].field_bar", + "nullable": false, + "description": "Bar field description", "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "boolean", - "recursive": false + "type": { + "com.linkedin.schema.BooleanType": {} + } + }, + "nativeDataType": "boolean", + "recursive": false, + "isPartOfKey": false } - ], - "primaryKeys": null, - "foreignKeysSpecs": null - } - } - ] - } - }, - "proposedDelta": null - } + ] + } + } +} ] \ No newline at end of file diff --git a/smoke-test/tests/e2e/timeline/timeline_test_datav3.json b/smoke-test/tests/e2e/timeline/timeline_test_datav3.json index 0ac422c9ab1f..8d45a468f068 100644 --- a/smoke-test/tests/e2e/timeline/timeline_test_datav3.json +++ b/smoke-test/tests/e2e/timeline/timeline_test_datav3.json @@ -1,131 +1,150 @@ [ - { - "auditHeader": null, - "proposedSnapshot": { - "com.linkedin.pegasus2avro.metadata.snapshot.DatasetSnapshot": { - "urn": "urn:li:dataset:(urn:li:dataPlatform:kafka,test-timeline-sample-kafka,PROD)", - "aspects": [ - { - "com.linkedin.pegasus2avro.dataset.DatasetProperties": { - "description": "A description 2", - "uri": null, - "tags": [], - "customProperties": { +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,test-timeline-sample-kafka,PROD)", + "changeType": "UPSERT", + "aspectName": "datasetProperties", + "aspect": { + "json": { + "customProperties": { "prop1": "fakeprop", "prop2": "yoshi" - } - } - }, - { - "com.linkedin.pegasus2avro.common.GlobalTags": { - "tags": [{ "tag": "urn:li:tag:Legacy" }, { "tag": "urn:li:tag:NeedsDocumentation"}] - } - }, - { - "com.linkedin.pegasus2avro.common.Ownership": { - "owners": [ + }, + "description": "A description 2", + "tags": [] + } + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,test-timeline-sample-kafka,PROD)", + "changeType": "UPSERT", + "aspectName": "globalTags", + "aspect": { + "json": { + "tags": [ + { + "tag": "urn:li:tag:Legacy" + }, + { + "tag": "urn:li:tag:NeedsDocumentation" + } + ] + } + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,test-timeline-sample-kafka,PROD)", + "changeType": "UPSERT", + "aspectName": "ownership", + "aspect": { + "json": { + "owners": [ { - "owner": "urn:li:corpuser:jdoe", - "type": "DATAOWNER", - "source": null + "owner": "urn:li:corpuser:jdoe", + "type": "DATAOWNER" }, { - "owner": "urn:li:corpuser:datahub", - "type": "DATAOWNER", - "source": null + "owner": "urn:li:corpuser:datahub", + "type": "DATAOWNER" } - ], - "lastModified": { + ], + "ownerTypes": {}, + "lastModified": { "time": 1581407189001, - "actor": "urn:li:corpuser:jdoe", - "impersonator": null - } + "actor": "urn:li:corpuser:jdoe" } - }, - { - "com.linkedin.pegasus2avro.common.InstitutionalMemory": { - "elements": [ + } + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,test-timeline-sample-kafka,PROD)", + "changeType": "UPSERT", + "aspectName": "institutionalMemory", + "aspect": { + "json": { + "elements": [ { - "url": "https://www.google.com", - "description": "Google", - "createStamp": { - "time": 1581407189000, - "actor": "urn:li:corpuser:jdoe", - "impersonator": null - } + "url": "https://www.google.com", + "description": "Google", + "createStamp": { + "time": 1581407189000, + "actor": "urn:li:corpuser:jdoe" + } } - ] - } - }, - { - "com.linkedin.pegasus2avro.schema.SchemaMetadata": { - "schemaName": "SampleKafkaSchema", - "platform": "urn:li:dataPlatform:kafka", - "version": 0, - "created": { + ] + } + } +}, +{ + "entityType": "dataset", + "entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,test-timeline-sample-kafka,PROD)", + "changeType": "UPSERT", + "aspectName": "schemaMetadata", + "aspect": { + "json": { + "schemaName": "SampleKafkaSchema", + "platform": "urn:li:dataPlatform:kafka", + "version": 0, + "created": { "time": 1581407189000, - "actor": "urn:li:corpuser:jdoe", - "impersonator": null - }, - "lastModified": { + "actor": "urn:li:corpuser:jdoe" + }, + "lastModified": { "time": 1581407189000, - "actor": "urn:li:corpuser:jdoe", - "impersonator": null - }, - "deleted": null, - "dataset": null, - "cluster": null, - "hash": "", - "platformSchema": { - "com.linkedin.pegasus2avro.schema.KafkaSchema": { - "documentSchema": "{\"type\":\"record\",\"name\":\"SampleKafkaSchema\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"Sample Kafka dataset\",\"fields\":[{\"name\":\"field_foo\",\"type\":[\"string\"]},{\"name\":\"field_bar\",\"type\":[\"boolean\"]}]}" + "actor": "urn:li:corpuser:jdoe" + }, + "hash": "", + "platformSchema": { + "com.linkedin.schema.KafkaSchema": { + "documentSchema": "{\"type\":\"record\",\"name\":\"SampleKafkaSchema\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"Sample Kafka dataset\",\"fields\":[{\"name\":\"field_foo\",\"type\":[\"string\"]},{\"name\":\"field_bar\",\"type\":[\"boolean\"]}]}" } - }, - "fields": [ + }, + "fields": [ { - "fieldPath": "[version=2.0].[type=boolean].field_foo_2", - "jsonPath": null, - "nullable": false, - "description": { - "string": "Foo field description" - }, - "type": { + "fieldPath": "[version=2.0].[type=boolean].field_foo_2", + "nullable": false, + "description": "Foo field description", "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "varchar(100)", - "globalTags": { - "tags": [{ "tag": "urn:li:tag:NeedsDocumentation" }] - }, - "recursive": false + "type": { + "com.linkedin.schema.BooleanType": {} + } + }, + "nativeDataType": "varchar(100)", + "recursive": false, + "globalTags": { + "tags": [ + { + "tag": "urn:li:tag:NeedsDocumentation" + } + ] + }, + "isPartOfKey": false }, { - "fieldPath": "[version=2.0].[type=boolean].field_foo_3", - "jsonPath": null, - "nullable": false, - "description": { - "string": "Foo field description" - }, - "type": { + "fieldPath": "[version=2.0].[type=boolean].field_foo_3", + "nullable": false, + "description": "Foo field description", "type": { - "com.linkedin.pegasus2avro.schema.BooleanType": {} - } - }, - "nativeDataType": "varchar(100)", - "globalTags": { - "tags": [{ "tag": "urn:li:tag:NeedsDocumentation" }] - }, - "recursive": false + "type": { + "com.linkedin.schema.BooleanType": {} + } + }, + "nativeDataType": "varchar(100)", + "recursive": false, + "globalTags": { + "tags": [ + { + "tag": "urn:li:tag:NeedsDocumentation" + } + ] + }, + "isPartOfKey": false } - ], - "primaryKeys": null, - "foreignKeysSpecs": null - } - } - ] - } - }, - "proposedDelta": null - } + ] + } + } +} ] \ No newline at end of file From 9050bba86c2a51a35b1bc4e6e4cb22b039d8f62a Mon Sep 17 00:00:00 2001 From: avi <252974426+aviraj-gour@users.noreply.github.com> Date: Tue, 17 Nov 2026 16:41:04 +0530 Subject: [PATCH 10/20] fix(ingest): show the reason in check metadata-file failures check metadata-file raised only the failure context, so an MCE with no aspects failed with just the file position. Include the failure message. Also note in breaking-changes.md that check metadata-file now counts MCPs and fails on an MCE with no aspects, and correct the import-cycle comment in the REST emitter. --- docs/how/breaking-changes.md | 4 +--- metadata-ingestion/src/datahub/cli/json_file.py | 2 +- metadata-ingestion/src/datahub/emitter/rest_emitter.py | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/how/breaking-changes.md b/docs/how/breaking-changes.md index a0a8524a7c87..964d23a74452 100644 --- a/docs/how/breaking-changes.md +++ b/docs/how/breaking-changes.md @@ -686,9 +686,7 @@ Requirements: - [#21116](https://github.com/datahub-project/datahub/pull/21116) **(GMS / Search)** New `siblingGroups` GraphQL query, used by the search "Show siblings" option and the dataset "Composed of" section. It is off by default: set `GRAPHQL_QUERY_MAX_SIBLING_GROUP_URNS` above 0 (the search UI sends up to 30 urns per page) to turn it on. Each request walks up to 1,000 sibling-group members per dataset, and with view authorization on (`VIEW_AUTHORIZATION_ENABLED`) it view-checks every member, so test it on your largest sibling groups before enabling. **Action:** none unless you want the feature. -- **(Ingestion / file source)** The `file` source now turns each `MetadataChangeEvent` it reads into one MCP per aspect, so transformers and sinks receive MCPs only. A `file` sink fed from it writes MCPs, and a custom transformer that handles only MCEs no longer sees these records. The stored aspects are the same. **Action:** none, unless a custom transformer expects MCEs from a file. - -- [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / file source)** The `file` source now turns each `MetadataChangeEvent` it reads into one MCP per aspect, so transformers and sinks receive MCPs only. A `file` sink fed from it writes MCPs, and a custom transformer that handles only MCEs no longer sees these records. `datahub check metadata-file --rewrite` therefore rewrites an MCE file as MCPs, and its `--unpack-mces` flag has no effect. The stored aspects are the same. **Action:** none, unless a custom transformer expects MCEs from a file. +- [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / file source)** The `file` source now turns each `MetadataChangeEvent` it reads into one MCP per aspect, so transformers and sinks receive MCPs only. A `file` sink fed from it writes MCPs, and a custom transformer that handles only MCEs no longer sees these records. `datahub check metadata-file --rewrite` therefore rewrites an MCE file as MCPs, and its `--unpack-mces` flag has no effect. `datahub check metadata-file` now counts MCPs (one per aspect) instead of MCEs in its summary, and reports an MCE with no aspects as a failure. The stored aspects are the same. **Action:** none, unless a custom transformer expects MCEs from a file. - [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / REST emitter)** `DatahubRestEmitter` and `DataHubGraph` now send a `MetadataChangeEvent` as its MCPs in one batch request, through the same endpoint the emitter uses for MCP batches, instead of posting it to `/entities?action=ingest`. The `datahub-rest` sink in `SYNC` and `ASYNC` mode sends an MCE as one MCP request per aspect, so its timeline shows one change per aspect instead of one per MCE; the default `ASYNC_BATCH` mode already sent MCPs. The stored aspects are the same. MCEs now follow the emit mode like MCPs do: `emit_mce`, and `emit` without `emit_mode`, use the emitter's `default_emit_mode` or the `DATAHUB_EMIT_MODE` environment variable (default `SYNC_PRIMARY`) instead of always writing synchronously. In the sink's `ASYNC` mode, GMS writes MCE aspects asynchronously, so a validation or database error for them no longer shows in the run report. An MCE is no longer written all-or-nothing: in the sink's `SYNC` and `ASYNC` modes, if GMS rejects one aspect, the aspects before it stay stored and the rest are not sent. An MCE with no aspects is no longer sent at all. **Action:** none, unless you rely on an MCE being written atomically. diff --git a/metadata-ingestion/src/datahub/cli/json_file.py b/metadata-ingestion/src/datahub/cli/json_file.py index e45ef9a77ceb..04289603673a 100644 --- a/metadata-ingestion/src/datahub/cli/json_file.py +++ b/metadata-ingestion/src/datahub/cli/json_file.py @@ -18,7 +18,7 @@ def check_mce_file(filepath: str) -> str: f"Event file check failed with errors. Raising first error found. Full report {mce_source.get_report().as_string()}" ) for failure in mce_source.get_report().failures: - raise Exception(failure.context) + raise Exception(f"{failure.message}: {failure.context}") raise Exception( f"Failed to process file due to {mce_source.get_report().failures}" ) diff --git a/metadata-ingestion/src/datahub/emitter/rest_emitter.py b/metadata-ingestion/src/datahub/emitter/rest_emitter.py index 6d591311372a..037326166e0c 100644 --- a/metadata-ingestion/src/datahub/emitter/rest_emitter.py +++ b/metadata-ingestion/src/datahub/emitter/rest_emitter.py @@ -860,7 +860,7 @@ def emit_mce(self, mce: MetadataChangeEvent) -> None: def _emit_mce(self, mce: MetadataChangeEvent, emit_mode: EmitMode) -> None: """Sends the MCE's aspects in one batch so GMS stamps them as one change; oversized MCEs are split across requests.""" - # Deferred to break the cycle mcp_builder -> ingestion.api.common -> graph.client -> rest_emitter. + # Deferred to break the cycle mcp_builder -> ingestion.api.workunit -> ingestion.api.common -> graph.client -> rest_emitter. from datahub.emitter.mcp_builder import mcps_from_mce _warn_mce_deprecated() From 7ce1e8d0272ef00cf792b29eceedb11839e6e7bf Mon Sep 17 00:00:00 2001 From: avi <252974426+aviraj-gour@users.noreply.github.com> Date: Wed, 18 Nov 2026 11:15:14 +0530 Subject: [PATCH 11/20] fix(ingest/file): apply the aspect filter to MCE-derived MCPs The file source now turns MCEs into MCPs, so the `aspect` option can filter them like native MCP records instead of passing the whole MCE. --- docs/how/breaking-changes.md | 2 +- .../src/datahub/ingestion/source/file.py | 8 ++++- .../tests/unit/serde/test_serde.py | 29 +++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/docs/how/breaking-changes.md b/docs/how/breaking-changes.md index 964d23a74452..994f13e5ecd6 100644 --- a/docs/how/breaking-changes.md +++ b/docs/how/breaking-changes.md @@ -686,7 +686,7 @@ Requirements: - [#21116](https://github.com/datahub-project/datahub/pull/21116) **(GMS / Search)** New `siblingGroups` GraphQL query, used by the search "Show siblings" option and the dataset "Composed of" section. It is off by default: set `GRAPHQL_QUERY_MAX_SIBLING_GROUP_URNS` above 0 (the search UI sends up to 30 urns per page) to turn it on. Each request walks up to 1,000 sibling-group members per dataset, and with view authorization on (`VIEW_AUTHORIZATION_ENABLED`) it view-checks every member, so test it on your largest sibling groups before enabling. **Action:** none unless you want the feature. -- [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / file source)** The `file` source now turns each `MetadataChangeEvent` it reads into one MCP per aspect, so transformers and sinks receive MCPs only. A `file` sink fed from it writes MCPs, and a custom transformer that handles only MCEs no longer sees these records. `datahub check metadata-file --rewrite` therefore rewrites an MCE file as MCPs, and its `--unpack-mces` flag has no effect. `datahub check metadata-file` now counts MCPs (one per aspect) instead of MCEs in its summary, and reports an MCE with no aspects as a failure. The stored aspects are the same. **Action:** none, unless a custom transformer expects MCEs from a file. +- [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / file source)** The `file` source now turns each `MetadataChangeEvent` it reads into one MCP per aspect, so transformers and sinks receive MCPs only. A `file` sink fed from it writes MCPs, and a custom transformer that handles only MCEs no longer sees these records. `datahub check metadata-file --rewrite` therefore rewrites an MCE file as MCPs, and its `--unpack-mces` flag has no effect. `datahub check metadata-file` now counts MCPs (one per aspect) instead of MCEs in its summary, and reports an MCE with no aspects as a failure. The `aspect` option now applies to these MCPs too, so it ingests only the matching aspect from an MCE instead of the whole MCE; without it, the stored aspects are the same. **Action:** none, unless a custom transformer expects MCEs from a file or a recipe sets `aspect` over an MCE file and relies on the whole MCE being ingested. - [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / REST emitter)** `DatahubRestEmitter` and `DataHubGraph` now send a `MetadataChangeEvent` as its MCPs in one batch request, through the same endpoint the emitter uses for MCP batches, instead of posting it to `/entities?action=ingest`. The `datahub-rest` sink in `SYNC` and `ASYNC` mode sends an MCE as one MCP request per aspect, so its timeline shows one change per aspect instead of one per MCE; the default `ASYNC_BATCH` mode already sent MCPs. The stored aspects are the same. MCEs now follow the emit mode like MCPs do: `emit_mce`, and `emit` without `emit_mode`, use the emitter's `default_emit_mode` or the `DATAHUB_EMIT_MODE` environment variable (default `SYNC_PRIMARY`) instead of always writing synchronously. In the sink's `ASYNC` mode, GMS writes MCE aspects asynchronously, so a validation or database error for them no longer shows in the run report. An MCE is no longer written all-or-nothing: in the sink's `SYNC` and `ASYNC` modes, if GMS rejects one aspect, the aspects before it stay stored and the rest are not sent. An MCE with no aspects is no longer sent at all. **Action:** none, unless you rely on an MCE being written atomically. diff --git a/metadata-ingestion/src/datahub/ingestion/source/file.py b/metadata-ingestion/src/datahub/ingestion/source/file.py index 5adbf873d42b..8c651087a433 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/file.py +++ b/metadata-ingestion/src/datahub/ingestion/source/file.py @@ -15,6 +15,7 @@ from datahub.configuration.validate_field_deprecation import pydantic_field_deprecated from datahub.configuration.validate_field_rename import pydantic_renamed_field from datahub.emitter.mcp import MetadataChangeProposalWrapper +from datahub.emitter.mcp_builder import mcps_from_mce from datahub.ingestion.api.common import PipelineContext from datahub.ingestion.api.decorators import ( SourceCapability, @@ -269,7 +270,12 @@ def get_workunits_internal( "Rewrite the file as MCPs.", context=f.path, ) - yield from MetadataWorkUnit(id, mce=obj).decompose_mce_into_mcps() + for mcp in mcps_from_mce(obj): + if ( + self.config.aspect is None + or mcp.aspectName == self.config.aspect + ): + yield MetadataWorkUnit(id, mcp=mcp) self.report.total_num_files += 1 self.report.append_total_bytes_on_disk(f.size) diff --git a/metadata-ingestion/tests/unit/serde/test_serde.py b/metadata-ingestion/tests/unit/serde/test_serde.py index 981cd9f14c38..d4aa56eb9ebe 100644 --- a/metadata-ingestion/tests/unit/serde/test_serde.py +++ b/metadata-ingestion/tests/unit/serde/test_serde.py @@ -121,6 +121,35 @@ def test_file_source_reports_mce_without_aspects(tmp_path: pathlib.Path) -> None assert len(source.report.failures) == 1 +def test_file_source_aspect_filter_applies_to_mces(tmp_path: pathlib.Path) -> None: + json_path = tmp_path / "mce.json" + urn = mce_builder.make_dataset_urn("hive", "db.table") + write_metadata_file( + json_path, + [ + MetadataChangeEventClass( + proposedSnapshot=models.DatasetSnapshotClass( + urn=urn, + aspects=[ + models.StatusClass(removed=False), + models.DatasetPropertiesClass(description="d"), + ], + ) + ) + ], + ) + source = GenericFileSource( + ctx=PipelineContext(run_id="file-source-mce-aspect"), + config=FileSourceConfig(path=str(json_path), aspect="status"), + ) + + assert [wu.metadata for wu in source.get_workunits_internal()] == [ + MetadataChangeProposalWrapper( + entityUrn=urn, aspect=models.StatusClass(removed=False) + ) + ] + + @pytest.mark.parametrize( "json_filename", [ From 54b66785208df84c0c192f32ac03a93459bbd0c6 Mon Sep 17 00:00:00 2001 From: avi <252974426+aviraj-gour@users.noreply.github.com> Date: Wed, 25 Nov 2026 13:57:45 +0530 Subject: [PATCH 12/20] fix(ingest): skip MCEs without aspects and batch MCEs in the REST sink - The file source skips an MCE with no aspects with a report warning instead of failing the run, and gives each MCP from an MCE its own work unit id so failures name the aspect. - The datahub-rest sink sends an MCE's aspects as one emit_mcps batch in SYNC/ASYNC mode, matching DataHubRestEmitter. - datahub check metadata-file prints report warnings under its summary, so skipped records are visible. --- docs/how/breaking-changes.md | 4 ++-- metadata-ingestion/src/datahub/cli/json_file.py | 7 +++++-- .../src/datahub/ingestion/sink/datahub_rest.py | 3 +-- metadata-ingestion/src/datahub/ingestion/source/file.py | 7 ++++--- metadata-ingestion/tests/unit/serde/test_serde.py | 6 ++++-- metadata-ingestion/tests/unit/test_rest_sink.py | 9 ++++----- 6 files changed, 20 insertions(+), 16 deletions(-) diff --git a/docs/how/breaking-changes.md b/docs/how/breaking-changes.md index 994f13e5ecd6..1bdf6f5ce225 100644 --- a/docs/how/breaking-changes.md +++ b/docs/how/breaking-changes.md @@ -686,9 +686,9 @@ Requirements: - [#21116](https://github.com/datahub-project/datahub/pull/21116) **(GMS / Search)** New `siblingGroups` GraphQL query, used by the search "Show siblings" option and the dataset "Composed of" section. It is off by default: set `GRAPHQL_QUERY_MAX_SIBLING_GROUP_URNS` above 0 (the search UI sends up to 30 urns per page) to turn it on. Each request walks up to 1,000 sibling-group members per dataset, and with view authorization on (`VIEW_AUTHORIZATION_ENABLED`) it view-checks every member, so test it on your largest sibling groups before enabling. **Action:** none unless you want the feature. -- [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / file source)** The `file` source now turns each `MetadataChangeEvent` it reads into one MCP per aspect, so transformers and sinks receive MCPs only. A `file` sink fed from it writes MCPs, and a custom transformer that handles only MCEs no longer sees these records. `datahub check metadata-file --rewrite` therefore rewrites an MCE file as MCPs, and its `--unpack-mces` flag has no effect. `datahub check metadata-file` now counts MCPs (one per aspect) instead of MCEs in its summary, and reports an MCE with no aspects as a failure. The `aspect` option now applies to these MCPs too, so it ingests only the matching aspect from an MCE instead of the whole MCE; without it, the stored aspects are the same. **Action:** none, unless a custom transformer expects MCEs from a file or a recipe sets `aspect` over an MCE file and relies on the whole MCE being ingested. +- [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / file source)** The `file` source now turns each `MetadataChangeEvent` it reads into one MCP per aspect, so transformers and sinks receive MCPs only. A `file` sink fed from it writes MCPs, and a custom transformer that handles only MCEs no longer sees these records. `datahub check metadata-file --rewrite` therefore rewrites an MCE file as MCPs, and its `--unpack-mces` flag has no effect. `datahub check metadata-file` now counts MCPs (one per aspect) instead of MCEs in its summary and lists the report warnings under it. An MCE with no aspects is skipped with a warning. The `aspect` option now applies to these MCPs too, so it ingests only the matching aspect from an MCE instead of the whole MCE; without it, the stored aspects are the same. **Action:** none, unless a custom transformer expects MCEs from a file or a recipe sets `aspect` over an MCE file and relies on the whole MCE being ingested. -- [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / REST emitter)** `DatahubRestEmitter` and `DataHubGraph` now send a `MetadataChangeEvent` as its MCPs in one batch request, through the same endpoint the emitter uses for MCP batches, instead of posting it to `/entities?action=ingest`. The `datahub-rest` sink in `SYNC` and `ASYNC` mode sends an MCE as one MCP request per aspect, so its timeline shows one change per aspect instead of one per MCE; the default `ASYNC_BATCH` mode already sent MCPs. The stored aspects are the same. MCEs now follow the emit mode like MCPs do: `emit_mce`, and `emit` without `emit_mode`, use the emitter's `default_emit_mode` or the `DATAHUB_EMIT_MODE` environment variable (default `SYNC_PRIMARY`) instead of always writing synchronously. In the sink's `ASYNC` mode, GMS writes MCE aspects asynchronously, so a validation or database error for them no longer shows in the run report. An MCE is no longer written all-or-nothing: in the sink's `SYNC` and `ASYNC` modes, if GMS rejects one aspect, the aspects before it stay stored and the rest are not sent. An MCE with no aspects is no longer sent at all. **Action:** none, unless you rely on an MCE being written atomically. +- [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / REST emitter)** `DatahubRestEmitter` and `DataHubGraph` now send a `MetadataChangeEvent` as its MCPs in one batch request, through the same endpoint the emitter uses for MCP batches, instead of posting it to `/entities?action=ingest`. The `datahub-rest` sink does the same in `SYNC` and `ASYNC` mode; the default `ASYNC_BATCH` mode already sent MCPs. The stored aspects are the same. MCEs now follow the emit mode like MCPs do: `emit_mce`, and `emit` without `emit_mode`, use the emitter's `default_emit_mode` or the `DATAHUB_EMIT_MODE` environment variable (default `SYNC_PRIMARY`) instead of always writing synchronously. In the sink's `ASYNC` mode, GMS writes MCE aspects asynchronously, so a validation or database error for them no longer shows in the run report. An MCE is no longer written all-or-nothing: if GMS rejects one aspect, others from the same MCE may already be stored. An MCE with no aspects is no longer sent at all. **Action:** none, unless you rely on an MCE being written atomically. - [#21155](https://github.com/datahub-project/datahub/pull/21155) **(Ingestion / datahub-gc)** The soft-deleted entity cleanup no longer hard-deletes a soft-deleted container that still has child entities, including soft-deleted, draft or hidden ones (on a server without the `includeHiddenLifecycleStages` search flag, hidden children are not counted). Hard-deleting it left every child linked to a container that no longer exists (before #20589, it removed the link altogether), so the subtree could not be restored. Such containers now stay soft-deleted, are counted in `num_soft_deleted_containers_retained_with_children`, and are listed in the run report. A subtree that is soft-deleted as a whole is now removed one level per run, children first, so a tree N levels deep takes N runs. **Action:** none. Restore the container to bring its subtree back, or delete its children so a later run can remove it. diff --git a/metadata-ingestion/src/datahub/cli/json_file.py b/metadata-ingestion/src/datahub/cli/json_file.py index 04289603673a..60db1ee9c618 100644 --- a/metadata-ingestion/src/datahub/cli/json_file.py +++ b/metadata-ingestion/src/datahub/cli/json_file.py @@ -22,5 +22,8 @@ def check_mce_file(filepath: str) -> str: raise Exception( f"Failed to process file due to {mce_source.get_report().failures}" ) - else: - return f"{mce_source.get_report().events_produced} MCPs found - all valid" + report = mce_source.get_report() + summary = f"{report.events_produced} MCPs found - all valid" + for warning in report.warnings: + summary += f"\nWarning: {warning.message}: {warning.context}" + return summary diff --git a/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py b/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py index 342c48afe4bd..98b1f38eecf7 100644 --- a/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py +++ b/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py @@ -409,8 +409,7 @@ def _emit_wrapper( ) -> None: # TODO: Add timing metrics if isinstance(record, MetadataChangeEvent): - for mcp in mcps_from_mce(record): - self.emitter.emit(mcp, emit_mode=emit_mode) + self.emitter.emit_mcps(list(mcps_from_mce(record)), emit_mode=emit_mode) else: self.emitter.emit(record, emit_mode=emit_mode) diff --git a/metadata-ingestion/src/datahub/ingestion/source/file.py b/metadata-ingestion/src/datahub/ingestion/source/file.py index 8c651087a433..8afb3c0f5df5 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/file.py +++ b/metadata-ingestion/src/datahub/ingestion/source/file.py @@ -257,8 +257,9 @@ def get_workunits_internal( else: yield MetadataWorkUnit(id, mcp_raw=obj) elif not obj.proposedSnapshot.aspects: - self.report.failure( - message="MetadataChangeEvent has no aspects", context=id + self.report.warning( + message="Skipped a MetadataChangeEvent with no aspects", + context=id, ) else: if not warned_mce: @@ -275,7 +276,7 @@ def get_workunits_internal( self.config.aspect is None or mcp.aspectName == self.config.aspect ): - yield MetadataWorkUnit(id, mcp=mcp) + yield MetadataWorkUnit(f"{id}-{mcp.aspectName}", mcp=mcp) self.report.total_num_files += 1 self.report.append_total_bytes_on_disk(f.size) diff --git a/metadata-ingestion/tests/unit/serde/test_serde.py b/metadata-ingestion/tests/unit/serde/test_serde.py index d4aa56eb9ebe..07f99decf103 100644 --- a/metadata-ingestion/tests/unit/serde/test_serde.py +++ b/metadata-ingestion/tests/unit/serde/test_serde.py @@ -100,7 +100,7 @@ def test_file_source_converts_mces_to_mcps( assert [list(w.context) for w in source.report.warnings] == [[str(mce_file)]] -def test_file_source_reports_mce_without_aspects(tmp_path: pathlib.Path) -> None: +def test_file_source_skips_mce_without_aspects(tmp_path: pathlib.Path) -> None: json_path = tmp_path / "empty_mce.json" write_metadata_file( json_path, @@ -118,7 +118,9 @@ def test_file_source_reports_mce_without_aspects(tmp_path: pathlib.Path) -> None ) assert list(source.get_workunits_internal()) == [] - assert len(source.report.failures) == 1 + assert not source.report.failures + assert len(source.report.warnings) == 1 + assert "no aspects" in check_mce_file(str(json_path)) def test_file_source_aspect_filter_applies_to_mces(tmp_path: pathlib.Path) -> None: diff --git a/metadata-ingestion/tests/unit/test_rest_sink.py b/metadata-ingestion/tests/unit/test_rest_sink.py index 188079f3040d..fa90ea1395dd 100644 --- a/metadata-ingestion/tests/unit/test_rest_sink.py +++ b/metadata-ingestion/tests/unit/test_rest_sink.py @@ -481,7 +481,7 @@ def test_rest_sink_config_accepts_client_config_dump(): assert cfg.server == "http://localhost:8080" -def test_emit_wrapper_sends_mce_as_one_mcp_per_aspect(): +def test_emit_wrapper_sends_mce_as_one_mcp_batch(): from unittest.mock import PropertyMock, patch status = models.StatusClass(removed=False) @@ -503,9 +503,8 @@ def test_emit_wrapper_sends_mce_as_one_mcp_per_aspect(): sink = DatahubRestSink.__new__(DatahubRestSink) sink._emit_wrapper(mce, emit_mode=EmitMode.SYNC_PRIMARY) - emitted = [c.args[0] for c in mock_emitter.emit.call_args_list] + mock_emitter.emit_mcps.assert_called_once() + emitted = mock_emitter.emit_mcps.call_args.args[0] assert all(isinstance(m, MetadataChangeProposalWrapper) for m in emitted) assert [m.aspect for m in emitted] == [status, properties] - assert {c.kwargs["emit_mode"] for c in mock_emitter.emit.call_args_list} == { - EmitMode.SYNC_PRIMARY - } + assert mock_emitter.emit_mcps.call_args.kwargs["emit_mode"] == EmitMode.SYNC_PRIMARY From dc559cf221bd6b98b00ef7278157c9133b327a20 Mon Sep 17 00:00:00 2001 From: avi <252974426+aviraj-gour@users.noreply.github.com> Date: Wed, 25 Nov 2026 14:41:59 +0530 Subject: [PATCH 13/20] fix(ingest/file): report an MCE that fails conversion and keep reading - The file source catches errors from mcps_from_mce per record, so an MCE with an invalid URN is one report failure instead of stopping the file. - breaking-changes.md notes that MCE files sent through the datahub-rest sink in SYNC/ASYNC mode show one timeline change per aspect. - The aspect option and _emit_mce docstring describe MCE behaviour; a test covers emit(mce) over OpenAPI. --- docs/how/breaking-changes.md | 2 +- .../src/datahub/emitter/rest_emitter.py | 2 +- .../src/datahub/ingestion/source/file.py | 13 ++++++-- .../tests/unit/sdk/test_rest_emitter.py | 30 +++++++++++++++++++ .../tests/unit/serde/test_serde.py | 27 +++++++++++++++++ 5 files changed, 70 insertions(+), 4 deletions(-) diff --git a/docs/how/breaking-changes.md b/docs/how/breaking-changes.md index 1bdf6f5ce225..32cc7df0b34e 100644 --- a/docs/how/breaking-changes.md +++ b/docs/how/breaking-changes.md @@ -686,7 +686,7 @@ Requirements: - [#21116](https://github.com/datahub-project/datahub/pull/21116) **(GMS / Search)** New `siblingGroups` GraphQL query, used by the search "Show siblings" option and the dataset "Composed of" section. It is off by default: set `GRAPHQL_QUERY_MAX_SIBLING_GROUP_URNS` above 0 (the search UI sends up to 30 urns per page) to turn it on. Each request walks up to 1,000 sibling-group members per dataset, and with view authorization on (`VIEW_AUTHORIZATION_ENABLED`) it view-checks every member, so test it on your largest sibling groups before enabling. **Action:** none unless you want the feature. -- [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / file source)** The `file` source now turns each `MetadataChangeEvent` it reads into one MCP per aspect, so transformers and sinks receive MCPs only. A `file` sink fed from it writes MCPs, and a custom transformer that handles only MCEs no longer sees these records. `datahub check metadata-file --rewrite` therefore rewrites an MCE file as MCPs, and its `--unpack-mces` flag has no effect. `datahub check metadata-file` now counts MCPs (one per aspect) instead of MCEs in its summary and lists the report warnings under it. An MCE with no aspects is skipped with a warning. The `aspect` option now applies to these MCPs too, so it ingests only the matching aspect from an MCE instead of the whole MCE; without it, the stored aspects are the same. **Action:** none, unless a custom transformer expects MCEs from a file or a recipe sets `aspect` over an MCE file and relies on the whole MCE being ingested. +- [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / file source)** The `file` source now turns each `MetadataChangeEvent` it reads into one MCP per aspect, so transformers and sinks receive MCPs only. A `file` sink fed from it writes MCPs, and a custom transformer that handles only MCEs no longer sees these records. `datahub check metadata-file --rewrite` therefore rewrites an MCE file as MCPs, and its `--unpack-mces` flag has no effect. `datahub check metadata-file` now counts MCPs (one per aspect) instead of MCEs in its summary and lists the report warnings under it. An MCE with no aspects is skipped with a warning. An MCE that cannot be converted, such as one with an invalid URN, is reported as a failure for that record and the rest of the file is still read. The `aspect` option now applies to these MCPs too, so it ingests only the matching aspect from an MCE instead of the whole MCE; without it, the stored aspects are the same. With the `datahub-rest` sink in `SYNC` or `ASYNC` mode, each of those MCPs is its own request, so the timeline shows one change per aspect instead of one per MCE. **Action:** none, unless a custom transformer expects MCEs from a file or a recipe sets `aspect` over an MCE file and relies on the whole MCE being ingested. - [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / REST emitter)** `DatahubRestEmitter` and `DataHubGraph` now send a `MetadataChangeEvent` as its MCPs in one batch request, through the same endpoint the emitter uses for MCP batches, instead of posting it to `/entities?action=ingest`. The `datahub-rest` sink does the same in `SYNC` and `ASYNC` mode; the default `ASYNC_BATCH` mode already sent MCPs. The stored aspects are the same. MCEs now follow the emit mode like MCPs do: `emit_mce`, and `emit` without `emit_mode`, use the emitter's `default_emit_mode` or the `DATAHUB_EMIT_MODE` environment variable (default `SYNC_PRIMARY`) instead of always writing synchronously. In the sink's `ASYNC` mode, GMS writes MCE aspects asynchronously, so a validation or database error for them no longer shows in the run report. An MCE is no longer written all-or-nothing: if GMS rejects one aspect, others from the same MCE may already be stored. An MCE with no aspects is no longer sent at all. **Action:** none, unless you rely on an MCE being written atomically. diff --git a/metadata-ingestion/src/datahub/emitter/rest_emitter.py b/metadata-ingestion/src/datahub/emitter/rest_emitter.py index 037326166e0c..086c9d057060 100644 --- a/metadata-ingestion/src/datahub/emitter/rest_emitter.py +++ b/metadata-ingestion/src/datahub/emitter/rest_emitter.py @@ -859,7 +859,7 @@ def emit_mce(self, mce: MetadataChangeEvent) -> None: self._emit_mce(mce, self._default_emit_mode) def _emit_mce(self, mce: MetadataChangeEvent, emit_mode: EmitMode) -> None: - """Sends the MCE's aspects in one batch so GMS stamps them as one change; oversized MCEs are split across requests.""" + """Sends the MCE's aspects in one batch, which GMS stamps as one change unless an oversized MCE is split across requests.""" # Deferred to break the cycle mcp_builder -> ingestion.api.workunit -> ingestion.api.common -> graph.client -> rest_emitter. from datahub.emitter.mcp_builder import mcps_from_mce diff --git a/metadata-ingestion/src/datahub/ingestion/source/file.py b/metadata-ingestion/src/datahub/ingestion/source/file.py index 8afb3c0f5df5..554e6061288b 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/file.py +++ b/metadata-ingestion/src/datahub/ingestion/source/file.py @@ -87,7 +87,7 @@ class FileSourceConfig(StatefulIngestionConfigBase): read_mode: FileReadMode = FileReadMode.AUTO aspect: Optional[str] = Field( default=None, - description="Set to an aspect to only read this aspect for ingestion.", + description="Set to an aspect to only read this aspect for ingestion. Also applies to the aspects of MetadataChangeEvents in the file.", ) count_all_before_starting: bool = Field( default=True, @@ -271,7 +271,16 @@ def get_workunits_internal( "Rewrite the file as MCPs.", context=f.path, ) - for mcp in mcps_from_mce(obj): + try: + mcps = list(mcps_from_mce(obj)) + except Exception as e: + self.report.failure( + message="Failed to convert MetadataChangeEvent to MCPs", + context=id, + exc=e, + ) + continue + for mcp in mcps: if ( self.config.aspect is None or mcp.aspectName == self.config.aspect diff --git a/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py b/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py index 0d66ba666e2e..2af70c448576 100644 --- a/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py +++ b/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py @@ -3149,6 +3149,36 @@ def test_emit_mce_posts_one_ingest_proposal_batch( callback.assert_called_once_with(None, "success") +def test_emit_mce_posts_one_openapi_request() -> None: + emitter = DataHubRestEmitter(MOCK_GMS_ENDPOINT, openapi_ingestion=True) + emitter._server_config = RestServiceConfig( + raw_config={"versions": {"acryldata/datahub": {"version": "v1.0.1rc0"}}} + ) + mce = MetadataChangeEventClass( + proposedSnapshot=DatasetSnapshotClass( + urn=_MCE_URN, + aspects=[Status(removed=False), DatasetProperties(description="d")], + ) + ) + response = Mock(spec=Response) + response.status_code = 200 + response.headers = {} + response.json.return_value = [] + with ( + patch.object(emitter, "_emit_generic", return_value=response) as emit_generic, + pytest.warns(DataHubDeprecationWarning), + ): + emitter.emit(mce, emit_mode=EmitMode.SYNC_PRIMARY) + + emit_generic.assert_called_once() + assert ( + emit_generic.call_args.args[0] + == f"{MOCK_GMS_ENDPOINT}/openapi/v3/entity/dataset?async=false" + ) + entities = json.loads(emit_generic.call_args.kwargs["payload"]) + assert [set(e) - {"urn"} for e in entities] == [{"status"}, {"datasetProperties"}] + + def test_emit_mce_failure_reaches_callback( mce_emitter: DataHubRestEmitter, ) -> None: diff --git a/metadata-ingestion/tests/unit/serde/test_serde.py b/metadata-ingestion/tests/unit/serde/test_serde.py index 07f99decf103..dc8bb516f31a 100644 --- a/metadata-ingestion/tests/unit/serde/test_serde.py +++ b/metadata-ingestion/tests/unit/serde/test_serde.py @@ -100,6 +100,33 @@ def test_file_source_converts_mces_to_mcps( assert [list(w.context) for w in source.report.warnings] == [[str(mce_file)]] +def test_file_source_reports_unconvertible_mce_and_continues( + tmp_path: pathlib.Path, +) -> None: + json_path = tmp_path / "bad_urn_mce.json" + good_urn = mce_builder.make_dataset_urn("hive", "db.table") + write_metadata_file( + json_path, + [ + MetadataChangeEventClass( + proposedSnapshot=models.DatasetSnapshotClass( + urn=urn, aspects=[models.StatusClass(removed=False)] + ) + ) + for urn in ["not-a-urn", good_urn] + ], + ) + source = GenericFileSource( + ctx=PipelineContext(run_id="file-source-bad-urn-mce"), + config=FileSourceConfig(path=str(json_path)), + ) + + workunits = list(source.get_workunits_internal()) + + assert [wu.get_urn() for wu in workunits] == [good_urn] + assert len(source.report.failures) == 1 + + def test_file_source_skips_mce_without_aspects(tmp_path: pathlib.Path) -> None: json_path = tmp_path / "empty_mce.json" write_metadata_file( From 4f260b472a25a554c87b3a9bec5d52bfb06e861a Mon Sep 17 00:00:00 2001 From: avi <252974426+aviraj-gour@users.noreply.github.com> Date: Wed, 25 Nov 2026 15:07:54 +0530 Subject: [PATCH 14/20] refactor(ingest): share the MCE deprecation warning across emitters - MCE_DEPRECATION_MESSAGE and the once-per-process warn_mce_deprecated() live in generic_emitter, so the REST and Kafka emitters log it once between them instead of once each. - The datahub-rest sink explains why it unpacks MCEs itself instead of calling emitter.emit(). - Tests: the sink test builds the sink like its neighbours, and the empty-MCE test checks the warning names the record, not the file. --- .../src/datahub/emitter/generic_emitter.py | 16 ++++++++++++ .../src/datahub/emitter/kafka_emitter.py | 25 ++++++------------- .../src/datahub/emitter/rest_emitter.py | 24 ++++++------------ .../datahub/ingestion/sink/datahub_rest.py | 1 + .../tests/unit/sdk/test_kafka_emitter.py | 8 +++--- .../tests/unit/sdk/test_rest_emitter.py | 7 +++--- .../tests/unit/serde/test_serde.py | 3 ++- .../tests/unit/test_rest_sink.py | 17 +++++-------- 8 files changed, 48 insertions(+), 53 deletions(-) diff --git a/metadata-ingestion/src/datahub/emitter/generic_emitter.py b/metadata-ingestion/src/datahub/emitter/generic_emitter.py index 54b3d6841fe9..bfba28665b22 100644 --- a/metadata-ingestion/src/datahub/emitter/generic_emitter.py +++ b/metadata-ingestion/src/datahub/emitter/generic_emitter.py @@ -1,3 +1,5 @@ +import functools +import logging from typing import Callable, Optional, Union from typing_extensions import Protocol @@ -8,6 +10,20 @@ MetadataChangeProposal, ) +logger = logging.getLogger(__name__) + +MCE_DEPRECATION_MESSAGE = ( + "Emitting MetadataChangeEvents is deprecated and will be removed in a " + "future release. They are converted to MCPs; emit " + "MetadataChangeProposalWrapper instead." +) + + +# Shared by every emitter and cached so it prints once per process; the Airflow hook builds a new emitter per call. +@functools.lru_cache(maxsize=None) +def warn_mce_deprecated() -> None: + logger.warning(MCE_DEPRECATION_MESSAGE) + class Emitter(Protocol): def emit( diff --git a/metadata-ingestion/src/datahub/emitter/kafka_emitter.py b/metadata-ingestion/src/datahub/emitter/kafka_emitter.py index e6b36d38a624..8a9ac90b223b 100644 --- a/metadata-ingestion/src/datahub/emitter/kafka_emitter.py +++ b/metadata-ingestion/src/datahub/emitter/kafka_emitter.py @@ -1,4 +1,3 @@ -import functools import logging import threading import time @@ -19,7 +18,11 @@ from datahub.configuration.kafka import KafkaProducerConnectionConfig from datahub.configuration.kafka_consumer_config import KafkaOAuthCallbackResolver from datahub.configuration.validate_field_removal import pydantic_removed_field -from datahub.emitter.generic_emitter import Emitter +from datahub.emitter.generic_emitter import ( + MCE_DEPRECATION_MESSAGE, + Emitter, + warn_mce_deprecated, +) from datahub.emitter.mcp import MetadataChangeProposalWrapper from datahub.errors import DataHubDeprecationWarning from datahub.ingestion.api.closeable import Closeable @@ -53,12 +56,6 @@ # stall stays visible to operators instead of going silent after the first log. _QUEUE_FULL_WARN_EVERY_N_POLLS = 30 -_MCE_DEPRECATION_MESSAGE = ( - "Emitting MetadataChangeEvents is deprecated and will be removed in a " - "future release. They are converted to MCPs; emit " - "MetadataChangeProposalWrapper instead." -) - class MessageTooLargeError(Exception): """A serialized Kafka message exceeded producer ``message.max.bytes``. @@ -214,7 +211,7 @@ def emit( # type: ignore[override] return self.emit_mcp_async(item, callback or _error_reporting_callback) else: warnings.warn( - _MCE_DEPRECATION_MESSAGE, DataHubDeprecationWarning, stacklevel=2 + MCE_DEPRECATION_MESSAGE, DataHubDeprecationWarning, stacklevel=2 ) return self._emit_mce(item, callback or _error_reporting_callback) @@ -299,7 +296,7 @@ def _record_backpressure(self, blocked_seconds: float) -> None: self.backpressure_engagements += 1 self.backpressure_blocked_seconds += blocked_seconds - @deprecated(_MCE_DEPRECATION_MESSAGE, category=DataHubDeprecationWarning) + @deprecated(MCE_DEPRECATION_MESSAGE, category=DataHubDeprecationWarning) def emit_mce_async( self, mce: MetadataChangeEvent, @@ -316,7 +313,7 @@ def _emit_mce(self, mce: MetadataChangeEvent, callback: KafkaOnDelivery) -> None # Deferred: mcp_builder pulls in ingestion sources, which pgqueue must not import. from datahub.emitter.mcp_builder import mcps_from_mce - _warn_mce_deprecated() + warn_mce_deprecated() # The MCP topic is consumed by every GMS that consumes the MCE topic. mcps = list(mcps_from_mce(mce)) if not mcps: @@ -427,12 +424,6 @@ def suppress(self) -> bool: return already_failed -# Cached so the warning prints once per process: the Airflow hook builds a new emitter per call. -@functools.lru_cache(maxsize=None) -def _warn_mce_deprecated() -> None: - logger.warning(_MCE_DEPRECATION_MESSAGE) - - def _error_reporting_callback(err: Any, msg: Any) -> None: if err: logger.error(f"Failed to emit to kafka: {err} {msg}") diff --git a/metadata-ingestion/src/datahub/emitter/rest_emitter.py b/metadata-ingestion/src/datahub/emitter/rest_emitter.py index 086c9d057060..e14756ba6966 100644 --- a/metadata-ingestion/src/datahub/emitter/rest_emitter.py +++ b/metadata-ingestion/src/datahub/emitter/rest_emitter.py @@ -67,7 +67,11 @@ # EmitMode` imports keep working; the class now lives in its own leaf module so # graph.config can reference it for the default_emit_mode field without a cycle. from datahub.emitter.emit_mode import EmitMode as EmitMode -from datahub.emitter.generic_emitter import Emitter +from datahub.emitter.generic_emitter import ( + MCE_DEPRECATION_MESSAGE, + Emitter, + warn_mce_deprecated, +) from datahub.emitter.mcp import MetadataChangeProposalWrapper from datahub.emitter.request_helper import ( OpenApiRequest, @@ -147,12 +151,6 @@ # This applies to pretty much all calls to GMS. INGEST_MAX_PAYLOAD_BYTES = get_rest_emitter_batch_max_payload_bytes() -_MCE_DEPRECATION_MESSAGE = ( - "Emitting MetadataChangeEvents is deprecated and will be removed in a " - "future release. They are converted to MCPs; emit " - "MetadataChangeProposalWrapper instead." -) - # This limit is somewhat arbitrary. All GMS endpoints will timeout # and return a 500 if processing takes too long. To avoid sending # too much to the backend and hitting a timeout, we try to limit @@ -842,7 +840,7 @@ def emit( self.emit_mcp(item, emit_mode=emit_mode) else: warnings.warn( - _MCE_DEPRECATION_MESSAGE, DataHubDeprecationWarning, stacklevel=2 + MCE_DEPRECATION_MESSAGE, DataHubDeprecationWarning, stacklevel=2 ) self._emit_mce(item, emit_mode) except Exception as e: @@ -853,7 +851,7 @@ def emit( if callback: callback(None, "success") # type: ignore - @deprecated(_MCE_DEPRECATION_MESSAGE, category=DataHubDeprecationWarning) + @deprecated(MCE_DEPRECATION_MESSAGE, category=DataHubDeprecationWarning) def emit_mce(self, mce: MetadataChangeEvent) -> None: """Emit an MCE as one MCP per aspect, with the default emit mode.""" self._emit_mce(mce, self._default_emit_mode) @@ -863,7 +861,7 @@ def _emit_mce(self, mce: MetadataChangeEvent, emit_mode: EmitMode) -> None: # Deferred to break the cycle mcp_builder -> ingestion.api.workunit -> ingestion.api.common -> graph.client -> rest_emitter. from datahub.emitter.mcp_builder import mcps_from_mce - _warn_mce_deprecated() + warn_mce_deprecated() mcps = list(mcps_from_mce(mce)) if not mcps: logger.warning(f"MCE for {mce.proposedSnapshot.urn} produced zero MCPs") @@ -1439,9 +1437,3 @@ def close(self) -> None: """This class exists as a pass-through for backwards compatibility""" DatahubRestEmitter = DataHubRestEmitter - - -# Cached so the warning prints once per process, however many emitters or MCEs there are. -@functools.lru_cache(maxsize=None) -def _warn_mce_deprecated() -> None: - logger.warning(_MCE_DEPRECATION_MESSAGE) diff --git a/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py b/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py index 98b1f38eecf7..562774d2a869 100644 --- a/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py +++ b/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py @@ -409,6 +409,7 @@ def _emit_wrapper( ) -> None: # TODO: Add timing metrics if isinstance(record, MetadataChangeEvent): + # Not emitter.emit(): that logs an MCE deprecation warning recipe users cannot act on. self.emitter.emit_mcps(list(mcps_from_mce(record)), emit_mode=emit_mode) else: self.emitter.emit(record, emit_mode=emit_mode) diff --git a/metadata-ingestion/tests/unit/sdk/test_kafka_emitter.py b/metadata-ingestion/tests/unit/sdk/test_kafka_emitter.py index 51db6ceb4ecf..2526322dc54f 100644 --- a/metadata-ingestion/tests/unit/sdk/test_kafka_emitter.py +++ b/metadata-ingestion/tests/unit/sdk/test_kafka_emitter.py @@ -6,13 +6,13 @@ from confluent_kafka.schema_registry.error import SchemaRegistryError from datahub.configuration.common import ConfigurationError, ConfigurationWarning +from datahub.emitter.generic_emitter import warn_mce_deprecated from datahub.emitter.kafka_emitter import ( DEFAULT_MCP_KAFKA_TOPIC, MCE_KEY, MCP_KEY, DatahubKafkaEmitter, KafkaEmitterConfig, - _warn_mce_deprecated, ) from datahub.emitter.mcp import MetadataChangeProposalWrapper from datahub.errors import DataHubDeprecationWarning @@ -29,8 +29,8 @@ class KafkaEmitterTest(unittest.TestCase): def setUp(self): - _warn_mce_deprecated.cache_clear() - self.addCleanup(_warn_mce_deprecated.cache_clear) + warn_mce_deprecated.cache_clear() + self.addCleanup(warn_mce_deprecated.cache_clear) def test_kafka_emitter_config(self): with self.assertNoLogs("datahub.emitter.kafka_emitter", "WARNING"): @@ -172,7 +172,7 @@ def test_emit_mce_is_deprecated(self, mock_producer): with ( pytest.warns(DataHubDeprecationWarning) as warned, - self.assertLogs("datahub.emitter.kafka_emitter", "WARNING") as logs, + self.assertLogs("datahub.emitter.generic_emitter", "WARNING") as logs, ): emitter.emit(mce, callback=lambda err, msg: None) emitter.emit(mce, callback=lambda err, msg: None) diff --git a/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py b/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py index 2af70c448576..b4e036630f62 100644 --- a/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py +++ b/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py @@ -18,10 +18,10 @@ TraceValidationError, ) from datahub.emitter import rest_emitter +from datahub.emitter.generic_emitter import MCE_DEPRECATION_MESSAGE, warn_mce_deprecated from datahub.emitter.mcp import MetadataChangeProposalWrapper from datahub.emitter.response_helper import TraceData from datahub.emitter.rest_emitter import ( - _MCE_DEPRECATION_MESSAGE, BATCH_INGEST_MAX_PAYLOAD_LENGTH, INGEST_MAX_PAYLOAD_BYTES, DataHubRestEmitter, @@ -30,7 +30,6 @@ RequestsSessionConfig, RestSinkEndpoint, _KeepAliveHTTPAdapter, - _warn_mce_deprecated, logger, preserve_unicode_escapes, ) @@ -3090,7 +3089,7 @@ def test_restli_batch_coarsens_to_sync_when_any_marked(self, restli_emitter): @pytest.fixture def mce_emitter() -> DataHubRestEmitter: - _warn_mce_deprecated.cache_clear() + warn_mce_deprecated.cache_clear() return DataHubRestEmitter( MOCK_GMS_ENDPOINT, openapi_ingestion=False, default_emit_mode=EmitMode.ASYNC ) @@ -3216,4 +3215,4 @@ def test_mce_deprecation_logged_once_per_process( mce_emitter.emit(mce) mce_emitter.emit(mce) - assert caplog.text.count(_MCE_DEPRECATION_MESSAGE) == 1 + assert caplog.text.count(MCE_DEPRECATION_MESSAGE) == 1 diff --git a/metadata-ingestion/tests/unit/serde/test_serde.py b/metadata-ingestion/tests/unit/serde/test_serde.py index dc8bb516f31a..b1810e2c298e 100644 --- a/metadata-ingestion/tests/unit/serde/test_serde.py +++ b/metadata-ingestion/tests/unit/serde/test_serde.py @@ -146,7 +146,8 @@ def test_file_source_skips_mce_without_aspects(tmp_path: pathlib.Path) -> None: assert list(source.get_workunits_internal()) == [] assert not source.report.failures - assert len(source.report.warnings) == 1 + # The record, not the file: the per-file deprecation warning would name the file. + assert [list(w.context) for w in source.report.warnings] == [[f"{json_path}:0"]] assert "no aspects" in check_mce_file(str(json_path)) diff --git a/metadata-ingestion/tests/unit/test_rest_sink.py b/metadata-ingestion/tests/unit/test_rest_sink.py index fa90ea1395dd..061b7767ea1f 100644 --- a/metadata-ingestion/tests/unit/test_rest_sink.py +++ b/metadata-ingestion/tests/unit/test_rest_sink.py @@ -482,8 +482,6 @@ def test_rest_sink_config_accepts_client_config_dump(): def test_emit_wrapper_sends_mce_as_one_mcp_batch(): - from unittest.mock import PropertyMock, patch - status = models.StatusClass(removed=False) properties = models.DatasetPropertiesClass(description="d") mce = models.MetadataChangeEventClass( @@ -493,16 +491,13 @@ def test_emit_wrapper_sends_mce_as_one_mcp_batch(): ) ) mock_emitter = MagicMock() - with ( - patch.object(DatahubRestSink, "__init__", lambda self, *args, **kwargs: None), - patch.object( - DatahubRestSink, "emitter", new_callable=PropertyMock - ) as mock_emitter_prop, - ): - mock_emitter_prop.return_value = mock_emitter - sink = DatahubRestSink.__new__(DatahubRestSink) - sink._emit_wrapper(mce, emit_mode=EmitMode.SYNC_PRIMARY) + sink = DatahubRestSink.__new__(DatahubRestSink) + sink._emitter_thread_local = threading.local() + sink._emitter_thread_local.emitter = mock_emitter + + sink._emit_wrapper(mce, emit_mode=EmitMode.SYNC_PRIMARY) + mock_emitter.emit.assert_not_called() mock_emitter.emit_mcps.assert_called_once() emitted = mock_emitter.emit_mcps.call_args.args[0] assert all(isinstance(m, MetadataChangeProposalWrapper) for m in emitted) From 91f39fcd705d1f360ccbea12ab9c29ccd84999d5 Mon Sep 17 00:00:00 2001 From: avi <252974426+aviraj-gour@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:56:21 +0530 Subject: [PATCH 15/20] docs(ingest): remove lineage example that duplicates lineage_emitter_mcpw_rest.py --- .../examples/library/lineage_emitter_rest.py | 27 ------------------- 1 file changed, 27 deletions(-) delete mode 100644 metadata-ingestion/examples/library/lineage_emitter_rest.py diff --git a/metadata-ingestion/examples/library/lineage_emitter_rest.py b/metadata-ingestion/examples/library/lineage_emitter_rest.py deleted file mode 100644 index 266a1e4a83a0..000000000000 --- a/metadata-ingestion/examples/library/lineage_emitter_rest.py +++ /dev/null @@ -1,27 +0,0 @@ -import datahub.emitter.mce_builder as builder -from datahub.emitter.mcp import MetadataChangeProposalWrapper -from datahub.emitter.rest_emitter import DatahubRestEmitter -from datahub.metadata.schema_classes import ( - DatasetLineageTypeClass, - UpstreamClass, - UpstreamLineageClass, -) - -# Construct a lineage object. -lineage_mcp = MetadataChangeProposalWrapper( - entityUrn=builder.make_dataset_urn("hive", "logging_events"), # Downstream - aspect=UpstreamLineageClass( - upstreams=[ - UpstreamClass( - dataset=builder.make_dataset_urn("hive", "fct_users_deleted"), - type=DatasetLineageTypeClass.TRANSFORMED, - ), - ] - ), -) - -# Create an emitter to the GMS REST API. -emitter = DatahubRestEmitter("http://localhost:8080") - -# Emit metadata! -emitter.emit(lineage_mcp) From e99d05be1c4217eaec7f94cade604384978ff081 Mon Sep 17 00:00:00 2001 From: avi <252974426+aviraj-gour@users.noreply.github.com> Date: Wed, 25 Nov 2026 17:31:19 +0530 Subject: [PATCH 16/20] fix(ingest/file): title MCE report entries and drop --unpack-mces plumbing --- docs/how/breaking-changes.md | 2 +- metadata-ingestion/src/datahub/cli/check_cli.py | 3 --- metadata-ingestion/src/datahub/ingestion/source/file.py | 2 ++ metadata-ingestion/tests/unit/serde/test_serde.py | 4 +--- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/docs/how/breaking-changes.md b/docs/how/breaking-changes.md index 32cc7df0b34e..7650ae2b9cf7 100644 --- a/docs/how/breaking-changes.md +++ b/docs/how/breaking-changes.md @@ -662,7 +662,7 @@ Requirements: - [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / REST emitter)** Emitting a `MetadataChangeEvent` with `DatahubRestEmitter` or `DataHubGraph` (`emit` or `emit_mce`) is deprecated and will be removed in a future release. **Action:** emit `MetadataChangeProposalWrapper` instead. -- [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / file source)** Reading `MetadataChangeEvent` records with the `file` source is deprecated and will be removed in a future release. The run report shows a warning for each file that contains them. **Action:** rewrite the file as MCPs, for example by running it through the `file` source into the `file` sink. +- [#21356](https://github.com/datahub-project/datahub/pull/21356) **(Ingestion / file source)** Reading `MetadataChangeEvent` records with the `file` source is deprecated and will be removed in a future release. The run report shows a warning for each file that contains them, so `datahub ingest --strict-warnings` over such a file now exits non-zero. **Action:** rewrite the file as MCPs, for example by running it through the `file` source into the `file` sink. ### Other Notable Changes diff --git a/metadata-ingestion/src/datahub/cli/check_cli.py b/metadata-ingestion/src/datahub/cli/check_cli.py index cfaa78f6427c..792693cf9711 100644 --- a/metadata-ingestion/src/datahub/cli/check_cli.py +++ b/metadata-ingestion/src/datahub/cli/check_cli.py @@ -66,9 +66,6 @@ def metadata_file(json_file: str, rewrite: bool, unpack_mces: bool) -> None: "type": "file", "config": {"filename": json_file}, "extractor": "generic", - "extractor_config": { - "unpack_mces_into_mcps": unpack_mces, - }, }, "flags": {"set_system_metadata": False}, "sink": { diff --git a/metadata-ingestion/src/datahub/ingestion/source/file.py b/metadata-ingestion/src/datahub/ingestion/source/file.py index 554e6061288b..62fc044ea79a 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/file.py +++ b/metadata-ingestion/src/datahub/ingestion/source/file.py @@ -258,6 +258,7 @@ def get_workunits_internal( yield MetadataWorkUnit(id, mcp_raw=obj) elif not obj.proposedSnapshot.aspects: self.report.warning( + title="Skipped empty MetadataChangeEvent", message="Skipped a MetadataChangeEvent with no aspects", context=id, ) @@ -275,6 +276,7 @@ def get_workunits_internal( mcps = list(mcps_from_mce(obj)) except Exception as e: self.report.failure( + title="Failed to convert MetadataChangeEvent", message="Failed to convert MetadataChangeEvent to MCPs", context=id, exc=e, diff --git a/metadata-ingestion/tests/unit/serde/test_serde.py b/metadata-ingestion/tests/unit/serde/test_serde.py index b1810e2c298e..3aae0fc95270 100644 --- a/metadata-ingestion/tests/unit/serde/test_serde.py +++ b/metadata-ingestion/tests/unit/serde/test_serde.py @@ -298,9 +298,7 @@ def test_check_metadata_rewrite( output_file_path = tmp_path / "output.json" shutil.copyfile(json_input, output_file_path) - run_datahub_cmd( - ["check", "metadata-file", f"{output_file_path}", "--rewrite", "--unpack-mces"] - ) + run_datahub_cmd(["check", "metadata-file", f"{output_file_path}", "--rewrite"]) mce_helpers.check_golden_file( pytestconfig, output_path=output_file_path, golden_path=json_output_reference From d84b6352a063af89eaf4db000029fa2696f36315 Mon Sep 17 00:00:00 2001 From: avi <252974426+aviraj-gour@users.noreply.github.com> Date: Wed, 25 Nov 2026 22:05:17 +0530 Subject: [PATCH 17/20] fix(ingest): report empty MCEs in the REST sink, deprecate --unpack-mces, move mcps_from_mce to emitter.mcp --- .../src/datahub/cli/check_cli.py | 3 ++- .../src/datahub/emitter/kafka_emitter.py | 5 +--- metadata-ingestion/src/datahub/emitter/mcp.py | 24 +++++++++++++++++- .../src/datahub/emitter/mcp_builder.py | 18 +++---------- .../src/datahub/emitter/rest_emitter.py | 5 +--- .../src/datahub/ingestion/api/workunit.py | 4 +-- .../datahub/ingestion/sink/datahub_rest.py | 23 ++++++++++++++--- .../tests/unit/test_rest_sink.py | 25 +++++++++++++++++++ 8 files changed, 76 insertions(+), 31 deletions(-) diff --git a/metadata-ingestion/src/datahub/cli/check_cli.py b/metadata-ingestion/src/datahub/cli/check_cli.py index 792693cf9711..c1ae70d8b417 100644 --- a/metadata-ingestion/src/datahub/cli/check_cli.py +++ b/metadata-ingestion/src/datahub/cli/check_cli.py @@ -49,7 +49,8 @@ def check() -> None: "--unpack-mces", default=False, is_flag=True, - help="Deprecated and has no effect: MCEs are always converted into MCPs.", + deprecated=True, + help="Has no effect: MCEs are always converted into MCPs.", ) def metadata_file(json_file: str, rewrite: bool, unpack_mces: bool) -> None: """Check the schema of a metadata (MCE or MCP) JSON file.""" diff --git a/metadata-ingestion/src/datahub/emitter/kafka_emitter.py b/metadata-ingestion/src/datahub/emitter/kafka_emitter.py index 8a9ac90b223b..ba6cfa7a219a 100644 --- a/metadata-ingestion/src/datahub/emitter/kafka_emitter.py +++ b/metadata-ingestion/src/datahub/emitter/kafka_emitter.py @@ -23,7 +23,7 @@ Emitter, warn_mce_deprecated, ) -from datahub.emitter.mcp import MetadataChangeProposalWrapper +from datahub.emitter.mcp import MetadataChangeProposalWrapper, mcps_from_mce from datahub.errors import DataHubDeprecationWarning from datahub.ingestion.api.closeable import Closeable from datahub.metadata.schema_classes import ( @@ -310,9 +310,6 @@ def _emit_mce(self, mce: MetadataChangeEvent, callback: KafkaOnDelivery) -> None ``callback`` never fires after the raise, but may already have fired with an earlier aspect's error. """ - # Deferred: mcp_builder pulls in ingestion sources, which pgqueue must not import. - from datahub.emitter.mcp_builder import mcps_from_mce - warn_mce_deprecated() # The MCP topic is consumed by every GMS that consumes the MCE topic. mcps = list(mcps_from_mce(mce)) diff --git a/metadata-ingestion/src/datahub/emitter/mcp.py b/metadata-ingestion/src/datahub/emitter/mcp.py index 32206288af5d..1755ede07945 100644 --- a/metadata-ingestion/src/datahub/emitter/mcp.py +++ b/metadata-ingestion/src/datahub/emitter/mcp.py @@ -1,7 +1,16 @@ import dataclasses import json import warnings -from typing import TYPE_CHECKING, Dict, List, Optional, Sequence, Tuple, Union +from typing import ( + TYPE_CHECKING, + Dict, + Iterable, + List, + Optional, + Sequence, + Tuple, + Union, +) from datahub.emitter.aspect import ASPECT_MAP, JSON_CONTENT_TYPE from datahub.emitter.serialization_helper import post_json_transform, pre_json_transform @@ -12,6 +21,7 @@ DictWrapper, GenericAspectClass, KafkaAuditHeaderClass, + MetadataChangeEventClass, MetadataChangeLogClass, MetadataChangeProposalClass, SystemMetadataClass, @@ -274,3 +284,15 @@ def as_workunit( treat_errors_as_warnings=treat_errors_as_warnings, is_primary_source=is_primary_source, ) + + +def mcps_from_mce( + mce: MetadataChangeEventClass, +) -> Iterable[MetadataChangeProposalWrapper]: + for aspect in mce.proposedSnapshot.aspects: + yield MetadataChangeProposalWrapper( + entityUrn=mce.proposedSnapshot.urn, + auditHeader=mce.auditHeader, + aspect=aspect, + systemMetadata=mce.systemMetadata, + ) diff --git a/metadata-ingestion/src/datahub/emitter/mcp_builder.py b/metadata-ingestion/src/datahub/emitter/mcp_builder.py index 8a4336640b32..9486c32d3057 100644 --- a/metadata-ingestion/src/datahub/emitter/mcp_builder.py +++ b/metadata-ingestion/src/datahub/emitter/mcp_builder.py @@ -13,7 +13,10 @@ make_dataplatform_instance_urn, make_dataset_urn_with_platform_instance, ) -from datahub.emitter.mcp import MetadataChangeProposalWrapper +from datahub.emitter.mcp import ( + MetadataChangeProposalWrapper, + mcps_from_mce as mcps_from_mce, +) from datahub.emitter.mcp_patch_builder import MetadataPatchProposal from datahub.ingestion.api.workunit import MetadataWorkUnit from datahub.metadata.com.linkedin.pegasus2avro.common import ( @@ -30,7 +33,6 @@ DomainsClass, EmbedClass, GlobalTagsClass, - MetadataChangeEventClass, OwnerClass, OwnershipClass, OwnershipTypeClass, @@ -548,18 +550,6 @@ def gen_data_product( ) -def mcps_from_mce( - mce: MetadataChangeEventClass, -) -> Iterable[MetadataChangeProposalWrapper]: - for aspect in mce.proposedSnapshot.aspects: - yield MetadataChangeProposalWrapper( - entityUrn=mce.proposedSnapshot.urn, - auditHeader=mce.auditHeader, - aspect=aspect, - systemMetadata=mce.systemMetadata, - ) - - def create_embed_mcp(urn: str, embed_url: str) -> MetadataChangeProposalWrapper: return MetadataChangeProposalWrapper( entityUrn=urn, diff --git a/metadata-ingestion/src/datahub/emitter/rest_emitter.py b/metadata-ingestion/src/datahub/emitter/rest_emitter.py index e14756ba6966..77816fe158a2 100644 --- a/metadata-ingestion/src/datahub/emitter/rest_emitter.py +++ b/metadata-ingestion/src/datahub/emitter/rest_emitter.py @@ -72,7 +72,7 @@ Emitter, warn_mce_deprecated, ) -from datahub.emitter.mcp import MetadataChangeProposalWrapper +from datahub.emitter.mcp import MetadataChangeProposalWrapper, mcps_from_mce from datahub.emitter.request_helper import ( OpenApiRequest, has_sync_emit_marker, @@ -858,9 +858,6 @@ def emit_mce(self, mce: MetadataChangeEvent) -> None: def _emit_mce(self, mce: MetadataChangeEvent, emit_mode: EmitMode) -> None: """Sends the MCE's aspects in one batch, which GMS stamps as one change unless an oversized MCE is split across requests.""" - # Deferred to break the cycle mcp_builder -> ingestion.api.workunit -> ingestion.api.common -> graph.client -> rest_emitter. - from datahub.emitter.mcp_builder import mcps_from_mce - warn_mce_deprecated() mcps = list(mcps_from_mce(mce)) if not mcps: diff --git a/metadata-ingestion/src/datahub/ingestion/api/workunit.py b/metadata-ingestion/src/datahub/ingestion/api/workunit.py index 3dc1cdd9d855..2b4bfd7d5797 100644 --- a/metadata-ingestion/src/datahub/ingestion/api/workunit.py +++ b/metadata-ingestion/src/datahub/ingestion/api/workunit.py @@ -3,7 +3,7 @@ from typing import Iterable, Optional, Type, TypeVar, Union, overload from datahub.emitter.aspect import JSON_PATCH_CONTENT_TYPE, TIMESERIES_ASPECT_MAP -from datahub.emitter.mcp import MetadataChangeProposalWrapper +from datahub.emitter.mcp import MetadataChangeProposalWrapper, mcps_from_mce from datahub.ingestion.api.common import WorkUnit from datahub.metadata.com.linkedin.pegasus2avro.mxe import ( MetadataChangeEvent, @@ -162,8 +162,6 @@ def get_json_patch_aspect( return None def decompose_mce_into_mcps(self) -> Iterable["MetadataWorkUnit"]: - from datahub.emitter.mcp_builder import mcps_from_mce - assert isinstance(self.metadata, MetadataChangeEvent) yield from [ diff --git a/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py b/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py index 562774d2a869..7d0fc67b0552 100644 --- a/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py +++ b/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py @@ -398,6 +398,20 @@ def _write_done_callback( self.report.report_failure({"e": e}) write_callback.on_failure(record_envelope, Exception(e), {}) + def _mcps_from_mce( + self, mce: MetadataChangeEvent + ) -> List[MetadataChangeProposalWrapper]: + mcps = list(mcps_from_mce(mce)) + if not mcps: + logger.warning(f"MCE for {mce.proposedSnapshot.urn} produced zero MCPs") + self.report.report_warning( + { + "warning": "Skipped a MetadataChangeEvent with no aspects", + "info": {"urn": mce.proposedSnapshot.urn}, + } + ) + return mcps + def _emit_wrapper( self, record: Union[ @@ -409,8 +423,11 @@ def _emit_wrapper( ) -> None: # TODO: Add timing metrics if isinstance(record, MetadataChangeEvent): + mcps = self._mcps_from_mce(record) + if not mcps: + return # Not emitter.emit(): that logs an MCE deprecation warning recipe users cannot act on. - self.emitter.emit_mcps(list(mcps_from_mce(record)), emit_mode=emit_mode) + self.emitter.emit_mcps(mcps, emit_mode=emit_mode) else: self.emitter.emit(record, emit_mode=emit_mode) @@ -432,9 +449,7 @@ def _emit_batch_wrapper( event = record[0] if isinstance(event, MetadataChangeEvent): - # Unpack MCEs into MCPs. - mcps = mcps_from_mce(event) - events.extend(mcps) + events.extend(self._mcps_from_mce(event)) else: events.append(event) diff --git a/metadata-ingestion/tests/unit/test_rest_sink.py b/metadata-ingestion/tests/unit/test_rest_sink.py index 061b7767ea1f..eb9e6bdcb13d 100644 --- a/metadata-ingestion/tests/unit/test_rest_sink.py +++ b/metadata-ingestion/tests/unit/test_rest_sink.py @@ -16,6 +16,7 @@ from datahub.ingestion.sink.datahub_rest import ( DatahubRestSink, DatahubRestSinkConfig, + DataHubRestSinkReport, RestSinkMode, ) @@ -503,3 +504,27 @@ def test_emit_wrapper_sends_mce_as_one_mcp_batch(): assert all(isinstance(m, MetadataChangeProposalWrapper) for m in emitted) assert [m.aspect for m in emitted] == [status, properties] assert mock_emitter.emit_mcps.call_args.kwargs["emit_mode"] == EmitMode.SYNC_PRIMARY + + +@pytest.mark.parametrize("batch", [False, True]) +def test_sink_warns_on_mce_without_aspects(batch: bool) -> None: + mce = models.MetadataChangeEventClass( + proposedSnapshot=models.DatasetSnapshotClass( + urn="urn:li:dataset:(urn:li:dataPlatform:foo,bar,PROD)", + aspects=[], + ) + ) + mock_emitter = MagicMock() + sink = DatahubRestSink.__new__(DatahubRestSink) + sink._emitter_thread_local = threading.local() + sink._emitter_thread_local.emitter = mock_emitter + sink.report = DataHubRestSinkReport() + sink._gms_emit_mode = EmitMode.ASYNC + + if batch: + sink._emit_batch_wrapper([(mce,)]) + assert mock_emitter.emit_mcps.call_args.args[0] == [] + else: + sink._emit_wrapper(mce, emit_mode=EmitMode.SYNC_PRIMARY) + mock_emitter.emit_mcps.assert_not_called() + assert len(sink.report.warnings) == 1 From 1cd0dffcc88865697aa0949650110efa5b99a2ef Mon Sep 17 00:00:00 2001 From: avi <252974426+aviraj-gour@users.noreply.github.com> Date: Wed, 25 Nov 2026 22:51:42 +0530 Subject: [PATCH 18/20] fix(ingest): name the URN of skipped empty MCEs and import mcps_from_mce from emitter.mcp The file source's empty-MCE warning now gives the URN as well as the record position. The file source, REST sink and serde tests import mcps_from_mce from its new home instead of the mcp_builder re-export. Adds tests for the REST emitter sending nothing for an MCE with no aspects, and for check metadata-file still accepting --unpack-mces. --- .../src/datahub/ingestion/sink/datahub_rest.py | 5 ++--- .../src/datahub/ingestion/source/file.py | 5 ++--- .../tests/unit/sdk/test_rest_emitter.py | 18 ++++++++++++++++++ .../tests/unit/serde/test_serde.py | 16 +++++++++++++--- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py b/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py index 7d0fc67b0552..cbed429f18ee 100644 --- a/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py +++ b/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py @@ -26,8 +26,7 @@ get_rest_sink_default_max_threads, get_rest_sink_default_mode, ) -from datahub.emitter.mcp import MetadataChangeProposalWrapper -from datahub.emitter.mcp_builder import mcps_from_mce +from datahub.emitter.mcp import MetadataChangeProposalWrapper, mcps_from_mce from datahub.emitter.rest_emitter import ( BATCH_INGEST_MAX_PAYLOAD_LENGTH, DEFAULT_REST_EMITTER_ENDPOINT, @@ -426,7 +425,7 @@ def _emit_wrapper( mcps = self._mcps_from_mce(record) if not mcps: return - # Not emitter.emit(): that logs an MCE deprecation warning recipe users cannot act on. + # Not emitter.emit(): it only logs an MCE with no aspects and reports success; the sink reports it as a warning. self.emitter.emit_mcps(mcps, emit_mode=emit_mode) else: self.emitter.emit(record, emit_mode=emit_mode) diff --git a/metadata-ingestion/src/datahub/ingestion/source/file.py b/metadata-ingestion/src/datahub/ingestion/source/file.py index 62fc044ea79a..4f641de2761d 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/file.py +++ b/metadata-ingestion/src/datahub/ingestion/source/file.py @@ -14,8 +14,7 @@ from datahub.configuration.common import ConfigEnum from datahub.configuration.validate_field_deprecation import pydantic_field_deprecated from datahub.configuration.validate_field_rename import pydantic_renamed_field -from datahub.emitter.mcp import MetadataChangeProposalWrapper -from datahub.emitter.mcp_builder import mcps_from_mce +from datahub.emitter.mcp import MetadataChangeProposalWrapper, mcps_from_mce from datahub.ingestion.api.common import PipelineContext from datahub.ingestion.api.decorators import ( SourceCapability, @@ -260,7 +259,7 @@ def get_workunits_internal( self.report.warning( title="Skipped empty MetadataChangeEvent", message="Skipped a MetadataChangeEvent with no aspects", - context=id, + context=f"{id} {obj.proposedSnapshot.urn}", ) else: if not warned_mce: diff --git a/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py b/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py index b4e036630f62..82290d3120ea 100644 --- a/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py +++ b/metadata-ingestion/tests/unit/sdk/test_rest_emitter.py @@ -3178,6 +3178,24 @@ def test_emit_mce_posts_one_openapi_request() -> None: assert [set(e) - {"urn"} for e in entities] == [{"status"}, {"datasetProperties"}] +def test_emit_mce_without_aspects_sends_nothing( + mce_emitter: DataHubRestEmitter, +) -> None: + mce = MetadataChangeEventClass( + proposedSnapshot=DatasetSnapshotClass(urn=_MCE_URN, aspects=[]) + ) + callback = Mock() + with ( + patch.object(mce_emitter, "_emit_generic") as emit_generic, + pytest.warns(DataHubDeprecationWarning), + ): + mce_emitter.emit(mce, callback=callback) + + emit_generic.assert_not_called() + callback.assert_called_once() + assert callback.call_args.args[0] is None + + def test_emit_mce_failure_reaches_callback( mce_emitter: DataHubRestEmitter, ) -> None: diff --git a/metadata-ingestion/tests/unit/serde/test_serde.py b/metadata-ingestion/tests/unit/serde/test_serde.py index 3aae0fc95270..1efb3de91e5e 100644 --- a/metadata-ingestion/tests/unit/serde/test_serde.py +++ b/metadata-ingestion/tests/unit/serde/test_serde.py @@ -12,8 +12,7 @@ import datahub.metadata.schema_classes as models from datahub.cli.json_file import check_mce_file from datahub.emitter import mce_builder -from datahub.emitter.mcp import MetadataChangeProposalWrapper -from datahub.emitter.mcp_builder import mcps_from_mce +from datahub.emitter.mcp import MetadataChangeProposalWrapper, mcps_from_mce from datahub.emitter.serialization_helper import post_json_transform, pre_json_transform from datahub.ingestion.api.common import PipelineContext from datahub.ingestion.run.pipeline import Pipeline @@ -147,7 +146,10 @@ def test_file_source_skips_mce_without_aspects(tmp_path: pathlib.Path) -> None: assert list(source.get_workunits_internal()) == [] assert not source.report.failures # The record, not the file: the per-file deprecation warning would name the file. - assert [list(w.context) for w in source.report.warnings] == [[f"{json_path}:0"]] + urn = mce_builder.make_dataset_urn("hive", "db.table") + assert [list(w.context) for w in source.report.warnings] == [ + [f"{json_path}:0 {urn}"] + ] assert "no aspects" in check_mce_file(str(json_path)) @@ -249,6 +251,14 @@ def test_check_metadata_schema(pytestconfig: pytest.Config, json_filename: str) run_datahub_cmd(["check", "metadata-file", f"{json_file_path}"]) +def test_check_metadata_file_accepts_deprecated_unpack_mces( + pytestconfig: pytest.Config, +) -> None: + json_file_path = pytestconfig.rootpath / "examples/mce_files/single_mce.json" + + run_datahub_cmd(["check", "metadata-file", f"{json_file_path}", "--unpack-mces"]) + + def test_serde_paired(pytestconfig: pytest.Config) -> None: # Test with a pair of python object + json file. # Validates both deserialization and serialization. From 8f85f87f14c34a5a11f7daca32d700039fcd79c7 Mon Sep 17 00:00:00 2001 From: avi <252974426+aviraj-gour@users.noreply.github.com> Date: Fri, 27 Nov 2026 12:16:09 +0530 Subject: [PATCH 19/20] fix(ingest/file): warn about deprecated MCEs before skipping empty ones and print plain report context A file whose MCEs all have no aspects now also gets the per-file deprecation warning. datahub check metadata-file joins report context instead of printing the LossyList repr. --- metadata-ingestion/src/datahub/cli/json_file.py | 4 ++-- .../src/datahub/ingestion/source/file.py | 13 +++++++------ metadata-ingestion/tests/unit/serde/test_serde.py | 9 ++++++--- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/metadata-ingestion/src/datahub/cli/json_file.py b/metadata-ingestion/src/datahub/cli/json_file.py index 60db1ee9c618..9256a936644d 100644 --- a/metadata-ingestion/src/datahub/cli/json_file.py +++ b/metadata-ingestion/src/datahub/cli/json_file.py @@ -18,12 +18,12 @@ def check_mce_file(filepath: str) -> str: f"Event file check failed with errors. Raising first error found. Full report {mce_source.get_report().as_string()}" ) for failure in mce_source.get_report().failures: - raise Exception(f"{failure.message}: {failure.context}") + raise Exception(f"{failure.message}: {', '.join(failure.context)}") raise Exception( f"Failed to process file due to {mce_source.get_report().failures}" ) report = mce_source.get_report() summary = f"{report.events_produced} MCPs found - all valid" for warning in report.warnings: - summary += f"\nWarning: {warning.message}: {warning.context}" + summary += f"\nWarning: {warning.message}: {', '.join(warning.context)}" return summary diff --git a/metadata-ingestion/src/datahub/ingestion/source/file.py b/metadata-ingestion/src/datahub/ingestion/source/file.py index 4f641de2761d..35a939b28811 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/file.py +++ b/metadata-ingestion/src/datahub/ingestion/source/file.py @@ -255,12 +255,6 @@ def get_workunits_internal( yield MetadataWorkUnit(id, mcp=obj) else: yield MetadataWorkUnit(id, mcp_raw=obj) - elif not obj.proposedSnapshot.aspects: - self.report.warning( - title="Skipped empty MetadataChangeEvent", - message="Skipped a MetadataChangeEvent with no aspects", - context=f"{id} {obj.proposedSnapshot.urn}", - ) else: if not warned_mce: warned_mce = True @@ -271,6 +265,13 @@ def get_workunits_internal( "Rewrite the file as MCPs.", context=f.path, ) + if not obj.proposedSnapshot.aspects: + self.report.warning( + title="Skipped empty MetadataChangeEvent", + message="Skipped a MetadataChangeEvent with no aspects", + context=f"{id} {obj.proposedSnapshot.urn}", + ) + continue try: mcps = list(mcps_from_mce(obj)) except Exception as e: diff --git a/metadata-ingestion/tests/unit/serde/test_serde.py b/metadata-ingestion/tests/unit/serde/test_serde.py index 1efb3de91e5e..28db5be6f4fa 100644 --- a/metadata-ingestion/tests/unit/serde/test_serde.py +++ b/metadata-ingestion/tests/unit/serde/test_serde.py @@ -145,12 +145,15 @@ def test_file_source_skips_mce_without_aspects(tmp_path: pathlib.Path) -> None: assert list(source.get_workunits_internal()) == [] assert not source.report.failures - # The record, not the file: the per-file deprecation warning would name the file. urn = mce_builder.make_dataset_urn("hive", "db.table") assert [list(w.context) for w in source.report.warnings] == [ - [f"{json_path}:0 {urn}"] + [str(json_path)], + [f"{json_path}:0 {urn}"], ] - assert "no aspects" in check_mce_file(str(json_path)) + assert ( + f"Skipped a MetadataChangeEvent with no aspects: {json_path}:0 {urn}" + in check_mce_file(str(json_path)) + ) def test_file_source_aspect_filter_applies_to_mces(tmp_path: pathlib.Path) -> None: From 3922837f12f5e7fa3cc2be22c82f3a711b4ad678 Mon Sep 17 00:00:00 2001 From: avi <252974426+aviraj-gour@users.noreply.github.com> Date: Fri, 27 Nov 2026 12:44:55 +0530 Subject: [PATCH 20/20] fix(ingest/rest-sink): skip MCEs with no aspects before submitting them An empty MCE used to be submitted to the executor, where it sent nothing but the done-callback still counted it in total_records_written. The sink now reports it as a warning and acknowledges it with on_success before submission, as the Kafka sink does, so it is not counted as written in any mode. --- .../datahub/ingestion/sink/datahub_rest.py | 40 ++++++++-------- .../tests/unit/test_rest_sink.py | 47 +++++++++++++++---- 2 files changed, 58 insertions(+), 29 deletions(-) diff --git a/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py b/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py index cbed429f18ee..96215216193e 100644 --- a/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py +++ b/metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py @@ -397,20 +397,6 @@ def _write_done_callback( self.report.report_failure({"e": e}) write_callback.on_failure(record_envelope, Exception(e), {}) - def _mcps_from_mce( - self, mce: MetadataChangeEvent - ) -> List[MetadataChangeProposalWrapper]: - mcps = list(mcps_from_mce(mce)) - if not mcps: - logger.warning(f"MCE for {mce.proposedSnapshot.urn} produced zero MCPs") - self.report.report_warning( - { - "warning": "Skipped a MetadataChangeEvent with no aspects", - "info": {"urn": mce.proposedSnapshot.urn}, - } - ) - return mcps - def _emit_wrapper( self, record: Union[ @@ -422,11 +408,7 @@ def _emit_wrapper( ) -> None: # TODO: Add timing metrics if isinstance(record, MetadataChangeEvent): - mcps = self._mcps_from_mce(record) - if not mcps: - return - # Not emitter.emit(): it only logs an MCE with no aspects and reports success; the sink reports it as a warning. - self.emitter.emit_mcps(mcps, emit_mode=emit_mode) + self.emitter.emit_mcps(list(mcps_from_mce(record)), emit_mode=emit_mode) else: self.emitter.emit(record, emit_mode=emit_mode) @@ -448,7 +430,7 @@ def _emit_batch_wrapper( event = record[0] if isinstance(event, MetadataChangeEvent): - events.extend(self._mcps_from_mce(event)) + events.extend(mcps_from_mce(event)) else: events.append(event) @@ -477,6 +459,24 @@ def write_record_async( # should only have a high value if the sink is actually a bottleneck. with self.report.main_thread_blocking_timer: record = record_envelope.record + # Acknowledged here, not submitted, so it isn't counted as written (same as the Kafka sink). + if ( + isinstance(record, MetadataChangeEvent) + and not record.proposedSnapshot.aspects + ): + logger.warning( + f"Skipped MCE for {record.proposedSnapshot.urn}: no aspects" + ) + self.report.report_warning( + { + "warning": "Skipped a MetadataChangeEvent with no aspects", + "info": {"urn": record.proposedSnapshot.urn}, + } + ) + write_callback.on_success( + record_envelope, {"msg": "MCE had zero aspects"} + ) + return if self.config.mode == RestSinkMode.ASYNC: assert isinstance(self.executor, PartitionExecutor) partition_key = _get_partition_key(record_envelope) diff --git a/metadata-ingestion/tests/unit/test_rest_sink.py b/metadata-ingestion/tests/unit/test_rest_sink.py index eb9e6bdcb13d..18720dac5270 100644 --- a/metadata-ingestion/tests/unit/test_rest_sink.py +++ b/metadata-ingestion/tests/unit/test_rest_sink.py @@ -12,6 +12,7 @@ from datahub.emitter.mcp import MetadataChangeProposalWrapper from datahub.emitter.rest_emitter import DatahubRestEmitter, EmitMode from datahub.errors import DataHubDeprecationWarning +from datahub.ingestion.api.common import RecordEnvelope from datahub.ingestion.graph.config import DatahubClientConfig from datahub.ingestion.sink.datahub_rest import ( DatahubRestSink, @@ -506,14 +507,19 @@ def test_emit_wrapper_sends_mce_as_one_mcp_batch(): assert mock_emitter.emit_mcps.call_args.kwargs["emit_mode"] == EmitMode.SYNC_PRIMARY -@pytest.mark.parametrize("batch", [False, True]) -def test_sink_warns_on_mce_without_aspects(batch: bool) -> None: +def test_emit_batch_wrapper_expands_mces_in_order(): + status = models.StatusClass(removed=False) + properties = models.DatasetPropertiesClass(description="d") mce = models.MetadataChangeEventClass( proposedSnapshot=models.DatasetSnapshotClass( urn="urn:li:dataset:(urn:li:dataPlatform:foo,bar,PROD)", - aspects=[], + aspects=[status, properties], ) ) + mcp = MetadataChangeProposalWrapper( + entityUrn="urn:li:dataset:(urn:li:dataPlatform:foo,baz,PROD)", + aspect=models.StatusClass(removed=True), + ) mock_emitter = MagicMock() sink = DatahubRestSink.__new__(DatahubRestSink) sink._emitter_thread_local = threading.local() @@ -521,10 +527,33 @@ def test_sink_warns_on_mce_without_aspects(batch: bool) -> None: sink.report = DataHubRestSinkReport() sink._gms_emit_mode = EmitMode.ASYNC - if batch: - sink._emit_batch_wrapper([(mce,)]) - assert mock_emitter.emit_mcps.call_args.args[0] == [] - else: - sink._emit_wrapper(mce, emit_mode=EmitMode.SYNC_PRIMARY) - mock_emitter.emit_mcps.assert_not_called() + sink._emit_batch_wrapper([(mce,), (mcp,)]) + + emitted = mock_emitter.emit_mcps.call_args.args[0] + assert [m.aspect for m in emitted] == [status, properties, mcp.aspect] + assert all(isinstance(m, MetadataChangeProposalWrapper) for m in emitted) + + +def test_sink_skips_mce_without_aspects() -> None: + mce = models.MetadataChangeEventClass( + proposedSnapshot=models.DatasetSnapshotClass( + urn="urn:li:dataset:(urn:li:dataPlatform:foo,bar,PROD)", + aspects=[], + ) + ) + sink = DatahubRestSink.__new__(DatahubRestSink) + sink.config = DatahubRestSinkConfig( + server=MOCK_GMS_ENDPOINT, mode=RestSinkMode.ASYNC_BATCH + ) + sink.executor = MagicMock() + sink.report = DataHubRestSinkReport() + callback = MagicMock() + envelope: RecordEnvelope = RecordEnvelope(mce, metadata={}) + + sink.write_record_async(envelope, callback) + + sink.executor.submit.assert_not_called() + callback.on_success.assert_called_once() + assert callback.on_success.call_args.args[0] is envelope + callback.on_failure.assert_not_called() assert len(sink.report.warnings) == 1