Skip to content

Commit

Permalink
add dependencies to utils, fix imports, add init to templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellcassius committed Dec 14, 2023
1 parent f184556 commit aa357c5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pipelines/br_rj_riodejaneiro_bilhetagem/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

# SMTR Imports #

from pipelines.flows import (
from pipelines.templates.flows import (
default_capture_flow,
default_materialization_flow,
)
Expand Down
Empty file added pipelines/templates/__init__.py
Empty file.
16 changes: 13 additions & 3 deletions pipelines/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@
from basedosdados import Table
from basedosdados import Storage
from pytz import timezone
import math
import prefect
import pandas as pd
from google.cloud.storage.blob import Blob
import pymysql
import psycopg2
import psycopg2.extras
from redis_pal import RedisPal
import time


Expand Down Expand Up @@ -956,4 +955,15 @@ def generate_ftp_schedules(
labels=[label],
)
)
return clocks
return clocks

def set_default_parameters(
flow: prefect.Flow, default_parameters: dict
) -> prefect.Flow:
"""
Sets default parameters for a flow.
"""
for parameter in flow.parameters():
if parameter.name in default_parameters:
parameter.default = default_parameters[parameter.name]
return flow

0 comments on commit aa357c5

Please sign in to comment.