-
Notifications
You must be signed in to change notification settings - Fork 272
Description
Describe the bug
When I provide the metadata, the printed column level lineage is correct, but the figure generated doesn't contain this information.
Printed column lineage:
<default>.res.c1 <- db1.tab1.c1
SQL
insert into res
select c1
from db1.tab1 a join db1.tab2 bTo Reproduce
from sqllineage.core.metadata.dummy import DummyMetaDataProvider
from sqllineage.runner import LineageRunner
sql = """
insert into res
select c1
from db1.tab1 a join db1.tab2 b
"""
lr = LineageRunner(sql, metadata_provider=DummyMetaDataProvider({"db1.tab1": ["c1"], "db1.tab2": ["c2"]}))
lr.print_column_lineage()
lr.draw()Expected behavior
If I use the following sql (replace c1 with a.c1):
insert into res
select a.c1
from db1.tab1 a join db1.tab2 b
I can get the expected figure (the printed column lineage is the same):

Python version (available via python --version)
- 3.11.8
SQLLineage version (available via sqllineage --version):
- 1.5.2
Updated
I think the reason is that metadata provider is not currently used in visualization:
sqllineage/sqllineage/drawing.py
Line 168 in 5b7173e
| lr = LineageRunner(sql, dialect=dialect, verbose=True) |
I can get the expected behavior if I manually set the metadata_provider here. I guess there could be a better way of doing this.
