https://dagster.io/ logo
#dagster-feedback
Title
# dagster-feedback
b

Bernardo Cortez

07/13/2022, 5:57 PM
How can I test the usage of the
should_execute
argument of the
schedule
decorator with dagit? I have inserted a condition for my schedule not to run on weekends, but I can still see the runs scheduled for this next weekend... I wonder whether there is a problem with the implementation or the runs will be skipped when the time comes
y

yuhan

07/13/2022, 8:13 PM
you can test it in python, like:
Copy code
from dagster import build_schedule_context

execution_time = datetime(year=2019, month=2, day=27)
context_with_time = build_schedule_context(scheduled_execution_time=execution_time)

execution_data = always_skip_schedule.evaluate_tick(context_with_time)
assert execution_data.skip_message
assert (
    execution_data.skip_message
    == "should_execute function for always_skip_schedule returned false."
)
this is how we test it in our unit tests
👍 1
@Dagster Bot issue Consider providing a convenient way in Dagit to test schedule and sensor without waiting for next tick
d

Dagster Bot

07/13/2022, 8:14 PM
y

yuhan

07/13/2022, 8:16 PM
Filing a feature request issue to track the Dagit UX improvement
b

Bernardo Cortez

07/14/2022, 1:58 PM
Thanks!