generated from rudderlabs/rudder-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactored adding support for RETL and Profiles
- Loading branch information
Ranjeet
committed
Oct 3, 2024
1 parent
ff123fe
commit 6041849
Showing
15 changed files
with
848 additions
and
495 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
.PHONY: test | ||
test: | ||
python3 -m unittest discover -s rudder_airflow_provider/test | ||
pytest --cov=rudder_airflow_provider rudder_airflow_provider/test --cov-report=xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from datetime import datetime, timedelta | ||
|
||
from airflow import DAG | ||
|
||
from rudder_airflow_provider.operators.rudderstack import RudderstackProfilesOperator | ||
|
||
default_args = { | ||
"owner": "airflow", | ||
"depends_on_past": False, | ||
"email": ["[email protected]"], | ||
"email_on_failure": False, | ||
"email_on_retry": False, | ||
"retries": 1, | ||
"retry_delay": timedelta(minutes=5), | ||
} | ||
|
||
with DAG( | ||
"rudderstack-profiles-sample", | ||
default_args=default_args, | ||
description="A simple tutorial DAG", | ||
schedule_interval=timedelta(days=1), | ||
start_date=datetime(2021, 1, 1), | ||
catchup=False, | ||
tags=["rs-profiles"], | ||
) as dag: | ||
# profile_id is template field | ||
rs_operator = RudderstackProfilesOperator( | ||
profile_id="{{ var.value.profile_id }}", | ||
task_id="<replace task id>", | ||
connection_id="<rudderstack api connection id>", | ||
) | ||
|
||
if __name__ == "__main__": | ||
dag.test() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,30 +5,31 @@ | |
from rudder_airflow_provider.operators.rudderstack import RudderstackRETLOperator | ||
|
||
default_args = { | ||
'owner': 'airflow', | ||
'depends_on_past': False, | ||
'email': ['[email protected]'], | ||
'email_on_failure': False, | ||
'email_on_retry': False, | ||
'retries': 1, | ||
'retry_delay': timedelta(minutes=5) | ||
"owner": "airflow", | ||
"depends_on_past": False, | ||
"email": ["[email protected]"], | ||
"email_on_failure": False, | ||
"email_on_retry": False, | ||
"retries": 1, | ||
"retry_delay": timedelta(minutes=5), | ||
} | ||
|
||
with DAG('rudderstack-sample', | ||
with DAG( | ||
"rudderstack-sample", | ||
default_args=default_args, | ||
description='A simple tutorial DAG', | ||
description="A simple tutorial DAG", | ||
schedule_interval=timedelta(days=1), | ||
start_date=datetime(2021, 1, 1), | ||
catchup=False, | ||
tags=['rs']) as dag: | ||
tags=["rs"], | ||
) as dag: | ||
# retl_connection_id, sync_type are template fields | ||
rs_operator = RudderstackRETLOperator( | ||
retl_connection_id="{{ var.value.retl_connection_id }}", | ||
task_id='<replace task id>', | ||
connection_id='<rudderstack api connection id>', | ||
task_id="<replace task id>", | ||
connection_id="<rudderstack api connection id>", | ||
sync_type="{{ var.value.sync_type }}", | ||
wait_for_completion=True | ||
) | ||
|
||
if __name__ == "__main__": | ||
dag.test() | ||
dag.test() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
apache-airflow == 2.8.0 | ||
requests == 2.28.2 | ||
apache-airflow == 2.10.0 | ||
requests == 2.32.3 | ||
setuptools == 65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability | ||
pytest==7.3.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
def get_provider_info(): | ||
return { | ||
'package-name': 'rudderstack-airflow-provider', | ||
'name': 'rudderstack-airflow-provider', | ||
'description': 'Apache airflow provider for Rudderstack' | ||
"package-name": "rudderstack-airflow-provider", | ||
"name": "rudderstack-airflow-provider", | ||
"description": "Apache airflow provider for Rudderstack", | ||
} |
Oops, something went wrong.