Varun P
07/02/2023, 3:51 PM@schedule(
cron_schedule="0 9 * * 1-5",
job=dp_job,
execution_timezone="Europe/Stockholm",
)
def dp_job_run(context): return {"ops": {"daily_dag": {"config": {"table": 'a'}}}}
This is what I have.
Now I want something like this.
@schedule(
cron_schedule="0 9 * * 1-5",
job=dp_job,
execution_timezone="Europe/Stockholm",
)
def dp_job_run(context):
Tables=['a','b']
# want to do something like this
for i in Tables:
yield {"ops": {"daily_dag": {"config": {"table": i}}}}
Though yield does not work. But I hope this gets across what I need.
I have already defined the ops and jobs in other files.
I want to create unique jobs for every table name.Justin Taylor
07/03/2023, 12:12 PMRunRequest
object? It looks like you are yielding the config dictionary itself, but I don't think that is sufficient to get your job to run, even if you are pointing the schedule to the job in the decorator.Varun P
07/03/2023, 12:15 PMJustin Taylor
07/03/2023, 12:19 PMrepository
and this problem. Can you elaborate?
You will need to reference this schedule within your Definitions
call, or repository
, if that is the construct you are using.Varun P
07/03/2023, 12:30 PMrepository
works. WIll try your approach on using the RunRequest object.jamie
07/03/2023, 3:06 PMRunRequest
, you would yield
a RunRequest
for each config you get from the databaseVarun P
07/03/2023, 11:49 PM