Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5e9104c
Add airflow CI checks
Oct 18, 2024
bf0320f
update job run conditions for GH Action
Oct 18, 2024
1f63647
update job run condition
Oct 18, 2024
758e47e
fix workflow file
Oct 18, 2024
d007604
update step id
Oct 18, 2024
f35e51e
add orchestrate to paths
Oct 18, 2024
05aaf25
update workflow
Oct 18, 2024
6464899
update PR if condition
Oct 18, 2024
c86690b
separate dbt and airflow integration jobs
Oct 18, 2024
03441ea
New ci-airflow image
BAntonellini Oct 28, 2024
7fc734d
add test airflow webserver url
BAntonellini Oct 28, 2024
c0621ff
Disable load_dagbag test
BAntonellini Oct 28, 2024
f289935
New ci-airflow image
BAntonellini Oct 28, 2024
a25d2e3
Merge branch 'main' of github.com:datacoves/balboa into add_airflow_ci
BAntonellini Oct 28, 2024
291f0cf
Add datacoves_snowflake env vars
BAntonellini Oct 29, 2024
8dac2a3
Add dlt dependency
BAntonellini Oct 29, 2024
2fae044
Add DBT_HOME
BAntonellini Oct 29, 2024
9d8ab9a
Add DATACOVES__REPO_PATH
BAntonellini Oct 29, 2024
6484616
Test Airflow 2.10
BAntonellini Oct 29, 2024
9adf62b
Revert test load_dagbag + dag changes
BAntonellini Oct 29, 2024
ad09f7a
Test echo warning
BAntonellini Nov 5, 2024
96fa3b3
Test new ci-airflow image
BAntonellini Nov 5, 2024
e063977
Test new ci-airflow image
BAntonellini Nov 5, 2024
258429a
Add warning detection step
BAntonellini Nov 6, 2024
abd4fe5
Implement tee
BAntonellini Nov 6, 2024
80f0ae6
Move tee grabbing to a tmpfile
BAntonellini Nov 6, 2024
a0f8963
New ci-airflow image
BAntonellini Nov 7, 2024
59206ee
Fix failure detection
BAntonellini Nov 7, 2024
911344c
Change warning detection
BAntonellini Nov 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions .github/workflows/integration_airflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,44 @@ jobs:
name: Pull Request Airflow Tests
runs-on: ubuntu-latest

container: datacoves/ci-airflow-dbt-snowflake:3.2
container: datacoves/ci-airflow-dbt-snowflake:3.2.202411071210-20e3cf4a

env:
AIRBYTE__EXTRACT_LOCATION: /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/load
AIRFLOW__CORE__DAGS_FOLDER: /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/automate/airflow/dags
AIRFLOW__CORE__DAGS_FOLDER: /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/orchestrate/dags
AIRFLOW__CORE__DAGBAG_IMPORT_TIMEOUT: 300
AIRFLOW__WEBSERVER__BASE_URL: http://airflow-dev123.datacoveslocal.com
DATACOVES__DBT_HOME: /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/transform
DATACOVES__REPO_PATH: /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}

steps:
- name: Checkout branch
uses: actions/[email protected]
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

# - name: Set Datacoves Snowflake Environment Variables
# run: |
# pip install dlt
# python /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/load/dlt/loans/datacoves_snowflake.py

- name: Test DAG structure integrity (DagBag Loading)
run: "python /usr/app/load_dagbag.py"
# - name: Test DAG structure integrity (DagBag Loading)
# run: "python /usr/app/load_dagbag.py"

- name: Test DBT Sources against DAGs' YAML files
run: "python /usr/app/test_dags.py --dag-loadtime-threshold 1 --check-variable-usage"
id: test_airflow_dags
run: |
output=$(python /usr/app/test_dags.py --dag-loadtime-threshold 1 --check-variable-usage)
echo "$output"
echo "::set-output name=result::$output"

- name: Test Warning Message
run: |
if echo "${{ steps.test_airflow_dags.outputs.result }}" | grep -q 'Warnings found:'; then
echo "::warning file=app.py,line=10,col=5::DAGs have warnings. See test_dags results for more details."
else
echo "No warnings detected."
fi


7 changes: 5 additions & 2 deletions orchestrate/dags/daily_loan_run.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import datetime

from airflow.decorators import dag, task_group
from airflow.providers.airbyte.operators.airbyte import \
AirbyteTriggerSyncOperator
from airflow.models.variable import Variable
from airflow.providers.airbyte.operators.airbyte import AirbyteTriggerSyncOperator
from fivetran_provider_async.operators import FivetranOperator
from fivetran_provider_async.sensors import FivetranSensor
from operators.datacoves.bash import DatacovesBashOperator
from operators.datacoves.dbt import DatacovesDbtOperator

my_var = Variable.get("ng_test_var")


@dag(
default_args={"start_date": "2021-01"},
description="Loan Run",
Expand Down
8 changes: 4 additions & 4 deletions orchestrate/dags/datacoves_sample_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ def datacoves_sample_dag():

# Calling dbt commands
dbt_task = DatacovesDbtOperator(
task_id = "run_dbt_task",
bash_command = "dbt debug",
task_id="run_dbt_task",
bash_command="dbt debug",
)

# This is calling an external Python file after activating the venv
# use this instead of the Python Operator
python_task = DatacovesBashOperator(
task_id = "run_python_script",
task_id="run_python_script",
# Virtual Environment is automatically activated
# activate_venv=True,
bash_command = "python orchestrate/python_scripts/sample_script.py"
bash_command="python orchestrate/python_scripts/sample_script.py",
)

# Define task dependencies
Expand Down
Loading