Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
airflow-dags
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Team DB
airflow-dags
Commits
0dff2977
Commit
0dff2977
authored
3 months ago
by
edvs19
Browse files
Options
Downloads
Patches
Plain Diff
teste
parent
517416ad
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
teste_dag.py
+28
-28
28 additions, 28 deletions
teste_dag.py
with
28 additions
and
28 deletions
teste_dag.py
+
28
−
28
View file @
0dff2977
...
...
@@ -12,38 +12,38 @@ from airflow.providers.apache.spark.operators.spark_submit import SparkSubmitOpe
repo_home
=
'
/opt/airflow/dags/repo
'
@dag
(
params
=
{
"
input_file
"
:
Param
(
"
nofile.jsonl
"
,
"
jsonl to be used as input in landing to bronze
"
,
str
)
}
)
def
process_records
(
params
:
dict
):
"""
DAG que realiza o fluxo landing -> bronze -> silver -> gold
"""
#
@dag(
#
params={
#
"input_file" : Param(
#
"nofile.jsonl",
#
"jsonl to be used as input in landing to bronze",
#
str
#
)
#
}
#
)
#
def process_records(params: dict):
#
"""
#
DAG que realiza o fluxo landing -> bronze -> silver -> gold
#
"""
task_1
=
SparkSubmitOperator
(
application
=
f
"
{
repo_home
}
/gen_bronze.py
"
,
task_id
=
"
landing_to_bronze
"
,
packages
=
"
org.apache.hadoop:hadoop-aws:3.3.4
"
)
#
task_1 = SparkSubmitOperator(
#
application=f"{repo_home}/gen_bronze.py",
#
task_id="landing_to_bronze",
#
packages = "org.apache.hadoop:hadoop-aws:3.3.4"
#
)
task_2
=
BashOperator
(
task_id
=
"
dbt_setup
"
,
bash_command
=
f
"
rm -rf /tmp/proj_teste && cp -r
{
repo_home
}
/proj_teste /tmp/proj_teste
"
,
)
#
task_2 = BashOperator(
#
task_id="dbt_setup",
#
bash_command=f"rm -rf /tmp/proj_teste && cp -r {repo_home}/proj_teste /tmp/proj_teste",
#
)
task_3
=
BashOperator
(
task_id
=
"
bronze_to_silver_to_gold
"
,
cwd
=
"
/tmp/proj_teste
"
,
bash_command
=
"
dbt deps && dbt build
"
,
)
#
task_3 = BashOperator(
#
task_id="bronze_to_silver_to_gold",
#
cwd="/tmp/proj_teste",
#
bash_command="dbt deps && dbt build",
#
)
task_1
>>
task_2
>>
task_3
#
task_1 >> task_2 >> task_3
@dag
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment