astro-sdk
astro-sdk copied to clipboard
Set SQL project initialisation to also initialises Airflow db
Improve the project initialisation, so it also initialises an Airflow DB Improve the project's interface so commands used after init can reference the project directories & files at easy. Example of how we can benefit from this:
def generate(directory: Path, dags_directory: Path) -> None:
"""
Generate the Airflow DAG from a directory of SQL files.
:params directory: The directory containing the raw sql files.
:params dags_directory: The directory containing the generated DAG.
"""
project_dir = project_dir or Path.cwd()
project = Project.load_config()
dag_file = generate_dag(project.workflows_directory, project.dags_directory)
rprint("The DAG file", dag_file.resolve(), "has been successfully generated. :tada:") retrieve the configuration, by doing:
Codecov Report
Base: 97.16% // Head: 95.38% // Decreases project coverage by -1.78% :warning:
Coverage data is based on head (
20d39a2) compared to base (03fecd6). Patch coverage: 82.92% of modified lines in pull request are covered.
Additional details and impacted files
@@ Coverage Diff @@
## main #1070 +/- ##
==========================================
- Coverage 97.16% 95.38% -1.79%
==========================================
Files 11 12 +1
Lines 318 347 +29
Branches 30 32 +2
==========================================
+ Hits 309 331 +22
- Misses 5 12 +7
Partials 4 4
| Impacted Files | Coverage Δ | |
|---|---|---|
| sql-cli/sql_cli/project.py | 85.41% <80.00%> (-14.59%) |
:arrow_down: |
| sql-cli/sql_cli/configuration.py | 100.00% <100.00%> (ø) |
|
| sql-cli/sql_cli/constants.py | 100.00% <100.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.