reata / sqllineage

SQL Lineage Analysis Tool powered by Python
MIT License
1.19k stars 215 forks source link

fix: Set param from config #553

Closed delphisharp closed 2 months ago

delphisharp commented 5 months ago

Dear ALL:

目前模型的默认模式名是通过环境变量传递的,我认为实现方法不够python。 所以,我实现了另一种解决方法。

修改 sqllineage/config.py 实现配置项的读取和写入, 读取方法保持和已有方法兼容。 修改 sqllineage/core/models.py 的Schema 类,在每次初始化的时候动态读取配置 修改 sqllineage/runner.py的init方法,传入变量,并在 SQLLineageConfig 赋值 请大家提出意见,谢谢 Currently the default schema name of the model is passed through environment variables, and I think the implementation method is not python enough. So, I implemented another workaround.

Modify sqllineage/config.py to implement reading and writing of configuration items. The reading method remains compatible with the existing method. Modify the Schema class of sqllineage/core/models.py and dynamically read the configuration every time it is initialized. Modify the init method of sqllineage/runner.py, pass in variables, and assign values in SQLLineageConfig Please give your opinions, thank you

重新建立分支并提交 Re-branch and submit

first step to solve #536

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.51%. Comparing base (c23d38d) to head (33bf65e). Report is 3 commits behind head on master.

:exclamation: Current head 33bf65e differs from pull request most recent head 687f7da. Consider uploading reports for the commit 687f7da to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #553 +/- ## ======================================= Coverage 99.50% 99.51% ======================================= Files 41 41 Lines 2219 2251 +32 ======================================= + Hits 2208 2240 +32 Misses 11 11 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

reata commented 5 months ago

Do we have all the codes in this new branch? I remember we need to change the Schema model in #545

delphisharp commented 5 months ago

Do we have all the codes in this new branch? I remember we need to change the Schema model in #545

Sorry, there were some problems when my local branch was synchronized from upstream changes of the master. So a new branch was reopened.

reata commented 5 months ago

What's the difference between this and #555 ? Do they jointly solve #536 and is there any dependency, like I need to merge this PR first and then #555?