Hi all! I'm just getting started with DataHub. I...
# ingestion
b
Hi all! I'm just getting started with DataHub. I'm using Python and have the emitter working at a basic level. We have a different ingestion process that defines the "platform_instance" in YAML before ingestion. Is there a way to define the "platform_instance" when using the emitter? Here is some of the code I'm using:
Copy code
upstream_table_1 = UpstreamClass(
    dataset=builder.make_dataset_urn("DEPENDENCY_MAP", "upstream_table_4", "DEV"),
    type=DatasetLineageTypeClass.TRANSFORMED,
)
upstream_tables: List[UpstreamClass] = [upstream_table_1]
upstream_table_2 = UpstreamClass(
    dataset=builder.make_dataset_urn("DEPENDENCY_MAP", "upstream_table_3", "DEV"),
    type=DatasetLineageTypeClass.TRANSFORMED,
)
upstream_tables.append(upstream_table_2)

# Construct a lineage object.
upstream_lineage = UpstreamLineage(upstreams=upstream_tables)

# Construct a MetadataChangeProposalWrapper object.
lineage_mcp = MetadataChangeProposalWrapper(
    entityType="dataset",
    changeType=ChangeTypeClass.UPSERT,
    entityUrn=builder.make_dataset_urn("DEPENDENCY_MAP", "downstream", "DEV"),
    aspectName="upstreamLineage",
    aspect=upstream_lineage,
)


# Emit metadata
emitter.emit_mcp(lineage_mcp)
Thanks! --Rob
c
Please use
make_dataset_urn_with_platform_instance
instead of plain
make_dataset_urn
b
This is perfect, thanks very much!