Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
aa7303b
refactor(ingest): describe MCP output in comments and check metadata-…
aviraj-gour Nov 16, 2026
81c9d81
refactor(ingest/sql): drop SqlWorkUnit from return type hints
aviraj-gour Nov 16, 2026
cfd0ad1
test(ingest): drop dead MCE branches from connector tests
aviraj-gour Nov 16, 2026
a0e7cc6
refactor(ingest): store the bootstrap sample data as MCPs
aviraj-gour Nov 16, 2026
2743793
docs(ingest): teach MCPs in examples and docs
aviraj-gour Nov 16, 2026
decbb71
fix(ingest/rest): send MCEs as MCPs from the REST emitter
aviraj-gour Nov 16, 2026
22bb7d4
fix(ingest/file): read MCEs as MCPs in the file source
aviraj-gour Nov 16, 2026
2f8356a
fix(ingest/file): report MCEs without aspects and correct MCE docs
aviraj-gour Nov 17, 2026
edbdde6
fix(ingest): send an MCE's aspects as one batch from the REST emitter
aviraj-gour Nov 17, 2026
9050bba
fix(ingest): show the reason in check metadata-file failures
aviraj-gour Nov 17, 2026
7ce1e8d
fix(ingest/file): apply the aspect filter to MCE-derived MCPs
aviraj-gour Nov 18, 2026
54b6678
fix(ingest): skip MCEs without aspects and batch MCEs in the REST sink
aviraj-gour Nov 25, 2026
dc559cf
fix(ingest/file): report an MCE that fails conversion and keep reading
aviraj-gour Nov 25, 2026
4f260b4
refactor(ingest): share the MCE deprecation warning across emitters
aviraj-gour Nov 25, 2026
91f39fc
docs(ingest): remove lineage example that duplicates lineage_emitter_…
aviraj-gour Nov 25, 2026
e99d05b
fix(ingest/file): title MCE report entries and drop --unpack-mces plu…
aviraj-gour Nov 25, 2026
d84b635
fix(ingest): report empty MCEs in the REST sink, deprecate --unpack-m…
aviraj-gour Nov 25, 2026
1cd0dff
fix(ingest): name the URN of skipped empty MCEs and import mcps_from_…
aviraj-gour Nov 25, 2026
8f85f87
fix(ingest/file): warn about deprecated MCEs before skipping empty on…
aviraj-gour Nov 27, 2026
3922837
fix(ingest/rest-sink): skip MCEs with no aspects before submitting them
aviraj-gour Nov 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs-website/sphinx/apidocs/builder/mce-builder.rst
Original file line number Diff line number Diff line change
@@ -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
27 changes: 11 additions & 16 deletions docs/how/add-custom-data-platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -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://<your-logo-url>"
}
}
]
"entityType": "dataPlatform",
"entityUrn": "urn:li:dataPlatform:MyCustomDataPlatform",
"changeType": "UPSERT",
"aspectName": "dataPlatformInfo",
"aspect": {
"json": {
"datasetNameDelimiter": "/",
"name": "My Custom Data Platform",
"type": "OTHERS",
"logoUrl": "https://<your-logo-url>"
}
},
"proposedDelta": null
}
}
]
```
Expand Down
38 changes: 11 additions & 27 deletions docs/how/add-user-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions docs/how/breaking-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,10 @@ 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.

- [#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, 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

- [#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.
Expand All @@ -682,6 +686,10 @@ 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. 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.

- [#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.
Expand Down
44 changes: 13 additions & 31 deletions docs/troubleshooting/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
}
```

Expand Down
9 changes: 5 additions & 4 deletions metadata-ingestion/adding-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source:
type: file
config:
# Coordinates
path: ./path/to/mce/file.json
path: ./path/to/metadata/file.json

sink:
# sink configs
42 changes: 18 additions & 24 deletions metadata-ingestion/docs/transformer/dataset_transformer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1881,7 +1875,7 @@ transformers:
owners_json: "<path_to_owners_json>" # the JSON file mentioned at the start
```

After running `datahub ingest -c <path_to_recipe>`, our MCEs will now have the following owners appended:
After running `datahub ingest -c <path_to_recipe>`, the `ownership` aspect of each dataset will now have the following owners appended:

```json
"owners": [
Expand Down
4 changes: 1 addition & 3 deletions metadata-ingestion/docs/transformer/set_attribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) 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
Expand Down
16 changes: 0 additions & 16 deletions metadata-ingestion/examples/library/lineage_emitter_rest.py

This file was deleted.

Loading
Loading