Jake Kagan
01/18/2023, 10:55 PM__init__
file, and then i pass that to the top-level __init__
file:
from .jobs.__init__ import jobs, schedules
from dagster import Definitions
def scheduler(schedules: dict):
for schedule_name, schedule_config in schedules.items():
# set each schedule_name as a variable with the value of schedule_config
# should i use exec/globals? or is there a dagster solution that is not as risky??
jobs = Definitions(jobs=[*jobs])
scheduler(schedules) --> schedule_1 = ScheduleDefinition1
schedule_2 = ScheduleDefinition2
any way around this using dagsterchris
01/19/2023, 12:01 AMJake Kagan
01/19/2023, 12:10 AM__init__
from dagster import ScheduleDefinition
from .usage_from_bigq.usage_from_bigq import namea
from .usage_from_bigq.job_test import nameb
jobs = [namea, nameb]
schedules = {"basic_schedule": ScheduleDefinition(job=namea, cron_schedule="0 0 * * *", execution_timezone="US/Pacific")}
from .jobs.__init__ import jobs, schedules
from .jobs2.__init__ import jobs as jobs2, schedules as schedules2
from dagster import Definitions
jobs = Definitions(jobs=[*jobs, *jobs2])
question is what do i do with scheduleschris
01/19/2023, 12:19 AMDefinitions
is at module level?Jake Kagan
01/19/2023, 12:26 AM__init__
3. the top level __init__
i want my definitions to be at level 1, to get consolidated at level 2, and then all the job directories to get consolidated at level 3
the jobs are getting imported all the way up just fine, but i'm trying to figure out a way to also initialize the schedules, because it seems that if they are not defined at level 3 then they don't workchris
01/19/2023, 12:27 AMJake Kagan
01/19/2023, 12:27 AMchris
01/19/2023, 12:28 AMJake Kagan
01/19/2023, 12:28 AMchris
01/19/2023, 12:29 AMDefinitions
objectDefinitions(schedules=…, …
Jake Kagan
01/19/2023, 12:30 AMschedules = [ScheduleDefinition(job=namea, cron_schedule="0 0 * * *", execution_timezone="US/Pacific")]
jobs = Definitions(jobs=[*jobs],
schedules=[*schedules])
name=
parameter and it workschris
01/19/2023, 12:34 AMJake Kagan
01/19/2023, 12:34 AMchris
01/19/2023, 12:34 AM