Skip to content

Document SDK: expose dataPlatformInstance as a first-class field on Document #18062

Description

@acrylJonny

Summary

datahub.sdk.document.Document.create_document / create_external_document do not accept a dataPlatformInstance (platform instance) aspect. Connectors that need to set a platform instance on a Document currently fall back to the low-level doc._set_aspect(DataPlatformInstanceClass(...)) private API.

Current workaround

Both the Confluence and Quip document connectors do this:

doc._set_aspect(
    DataPlatformInstanceClass(
        platform=make_data_platform_urn(self.platform),
        instance=make_dataplatform_instance_urn(self.platform, self._instance_id),
    )
)

_set_aspect is a private method, so this is fragile and duplicated across connectors.

Proposed fix

Add first-class support for a platform instance to the Document SDK builders (e.g. a platform_instance / data_platform_instance parameter on create_document / create_external_document), then remove the _set_aspect workaround from the Confluence and Quip sources.

References

  • metadata-ingestion/src/datahub/ingestion/source/quip/quip_source.py (_set_platform_instance)
  • metadata-ingestion/src/datahub/ingestion/source/confluence/confluence_source.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions