Repository navigation
Conversation
…mport_snowflake_lineage_addition
jschoedl
left a comment
There was a problem hiding this comment.
Hi, thanks for the contribution!
snowflake_importer.py uses an EXECUTE IMMEDIATE script - can you replace this with plain queries from Python? The columns query already returns every table and column:
cur.execute_async(
"SELECT * FROM TABLE(SNOWFLAKE.CORE.GET_LINEAGE(%s, 'COLUMN', 'UPSTREAM', 1))",
(object_name,),
)This would be easier to test and maintain. It would also allow for better error messages and reduce the risk for SQL injections (imagine e.g. a column named x\', $$COLUMN$$, $$UPSTREAM$$, 1)) UNION ALL SELECT … -- in line 253).
|
I decide the keep the column cursor/loop of the lineage on the Snowflake side, to keep the snowflake query call as low as possible, for the SQL Injection a query template will enforce the control. |
#1630 resolved
uv run pytest)uv run ruff check --fix && uv run ruff format)