TadasG
06/13/2023, 7:47 PM1.3.9
@asset(group_name="hello_world")
def hello_world_asset() -> None:
print("HELLO WORLD")
hello_world_job = define_asset_job("hello_world_job", AssetSelection.groups("hello_world_asset"))
hello_world_schedule = ScheduleDefinition(job=hello_world_job, cron_schedule="30 */8 * * *")
@repository
def all_apps():
return [hello_world_schedule]
Nothing is outputted from my code just the task starts and finishes in 0.001 second what jackie
it should print "hello world" but doesn't...
2023-06-13 22:45:16 +0300 - dagster - DEBUG - hello_world_job - 634b3dd5-6a72-4265-9e3a-d1035622f12f - 254042 - RUN_START - Started execution of run for "hello_world_job".
2023-06-13 22:45:16 +0300 - dagster - DEBUG - hello_world_job - 634b3dd5-6a72-4265-9e3a-d1035622f12f - 254042 - ENGINE_EVENT - Executing steps using multiprocess executor: parent process (pid: 254042)
2023-06-13 22:45:16 +0300 - dagster - DEBUG - hello_world_job - 634b3dd5-6a72-4265-9e3a-d1035622f12f - 254042 - ENGINE_EVENT - Multiprocess executor: parent process exiting after 0.09ms (pid: 254042)
2023-06-13 22:45:16 +0300 - dagster - DEBUG - hello_world_job - 634b3dd5-6a72-4265-9e3a-d1035622f12f - 254042 - RUN_SUCCESS - Finished execution of run for "hello_world_job".
TadasG
06/13/2023, 7:51 PMfrom dagster import repository, ScheduleDefinition, job
@job
def hello_world_asset() -> None:
print("HELLO WORLD")
hello_world_schedule = ScheduleDefinition(job=hello_world_asset, cron_schedule="30 */8 * * *")
@repository
def all_apps():
return [hello_world_schedule]
Then my job starts twice and then when I run it from the dagit console it runs just fine and does what I want.
what jackieZach
06/13/2023, 7:54 PMTadasG
06/13/2023, 7:54 PMpoetry run dagster dev
TadasG
06/13/2023, 7:54 PMTadasG
06/13/2023, 7:54 PMZach
06/13/2023, 7:55 PMdagster dev
doesn't run any jobs directlyTadasG
06/13/2023, 7:55 PMpoetry run dagster dev
the job starts in the example I specified 😄TadasG
06/13/2023, 7:56 PMTadasG
06/13/2023, 7:56 PMdefine_asset_job
the job just finishes instantly when I trigger it through dagitZach
06/13/2023, 7:58 PMdagster dev
is causing a job to run unless it's being executed at the global level somewhere. But one thing that's suspicious to me is that your AssetSelection.groups is pointing to a slightly different name than the group that hello_world_asset
is defined as...Zach
06/13/2023, 8:00 PM@asset(group_name="hello_world")
def hello_world_asset(context) -> None:
<http://context.log.info|context.log.info>("HELLO WORLD")
owen
06/13/2023, 8:50 PM@job
def hello_world_asset() -> None:
print("HELLO WORLD")
The code inside an @job
decorated function is meant purely for defining dependencies between ops, and will be executed immediately upon importing the code. essentially, you're defining a job with no ops (so it completes instantly), and as a side-effect of defining the job, your message gets printed.Zach
06/13/2023, 8:53 PMTadasG
06/14/2023, 5:41 AM