Hello, I’m trying to add/delete lineage with pytho...
# troubleshoot
a
Hello, I’m trying to add/delete lineage with python emitter. Adding and modifying lineage works, but I cannot delete the lineage.
Copy code
import datahub.emitter.mce_builder as builder
from datahub.emitter.rest_emitter import DatahubRestEmitter

# Construct a lineage object.
lineage_mce = builder.make_lineage_mce(
    [], # Empty upstream dataset to delete the lineage.
    builder.make_dataset_urn("bigquery", "test.TEST_DATASET.dev", "PROD"),
)

# Create an emitter to the GMS REST API.
emitter = DatahubRestEmitter("<http://localhost:8080>")

# Emit metadata!
emitter.emit_mce(lineage_mce)
How can I delete the lineage with python REST Emitter? I’m using the latest(
v0.8.17
) version.
e
Hey! This should delete lineage. do you see the new version of this aspect in mysql after emitting above? or do you see errors?
a
@early-lamp-41924 Yep, in mysql the upstream lineage deleted properly, but on UI nothing happens.
e
@big-carpet-38439 Didn’t we fix this issue before? Setting the array as empty is not removing the edges.
b
Yes indeed
Hm. And the Dataset URN you're emitting for matches this Dataset exactly? (I'm assuming yes)
Are you using Neo4j or Elastic as your Graph Store?
a
I’m using Elastic as Graph Store.
b
Thanks Sunghwan. Let me try to reproduce this on our end and get back
👍 1
c
Hi I want the reverse of this, can we not delete the old lineage when we emit a new one?
Is there any option for that?
a
hey @careful-apple-42677, did you ever find a solution for this? i’d also like to emit new lineage while leaving existing lineage in place
b
Unfortunately the overwrite is the only option. That being said, we are planning to release some new GraphQL APIs that will make working with lineage much easier. cc @bulky-soccer-26729 !
a
nice, thanks for the reply @big-carpet-38439! Is there anywhere i can track that?
f
Hey, is
Empty upstream dataset
(as in the snippet above) still the only option to remove the lineage edge using SDK?