-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdlt_pipeline.py
More file actions
37 lines (25 loc) · 855 Bytes
/
dlt_pipeline.py
File metadata and controls
37 lines (25 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import logging
from datetime import datetime
from prefect import flow, task
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
@task(name="run-death-metal-pipeline")
def run_death_metal_pipeline():
from apoena_pipeline import main
logger.info("Executando pipeline dlt")
pipeline = main()
return {
"pipeline_name": pipeline.pipeline_name,
"destination": str(pipeline.destination),
"dataset_name": pipeline.dataset_name,
"status": "success",
"timestamp": datetime.now().isoformat()
}
@flow(name="Death Metal Workflow")
def death_metal_workflow():
logger.info("Iniciando Death Metal Workflow")
result = run_death_metal_pipeline()
logger.info("Workflow concluído com sucesso")
return result
if __name__ == "__main__":
death_metal_workflow()