Changeset View
Changeset View
Standalone View
Standalone View
python_modules/dagster-graphql/dagster_graphql_tests/graphql/setup.py
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | |||||
from dagster.core.definitions.decorators import job | from dagster.core.definitions.decorators import job | ||||
from dagster.core.definitions.partition import last_empty_partition | from dagster.core.definitions.partition import last_empty_partition | ||||
from dagster.core.definitions.reconstructable import ReconstructableRepository | from dagster.core.definitions.reconstructable import ReconstructableRepository | ||||
from dagster.core.host_representation import RepositoryLocation | from dagster.core.host_representation import RepositoryLocation | ||||
from dagster.core.host_representation.handle import python_user_process_api_from_instance | from dagster.core.host_representation.handle import python_user_process_api_from_instance | ||||
from dagster.core.log_manager import coerce_valid_log_level | from dagster.core.log_manager import coerce_valid_log_level | ||||
from dagster.core.storage.tags import RESUME_RETRY_TAG | from dagster.core.storage.tags import RESUME_RETRY_TAG | ||||
from dagster.core.test_utils import today_at_midnight | from dagster.core.test_utils import today_at_midnight | ||||
from dagster.seven import get_current_datetime_in_utc | |||||
from dagster.utils import file_relative_path, segfault | from dagster.utils import file_relative_path, segfault | ||||
@dagster_type_loader(String) | @dagster_type_loader(String) | ||||
def df_input_schema(_context, path): | def df_input_schema(_context, path): | ||||
with open(path, "r") as fd: | with open(path, "r") as fd: | ||||
return [OrderedDict(sorted(x.items(), key=lambda x: x[0])) for x in csv.DictReader(fd)] | return [OrderedDict(sorted(x.items(), key=lambda x: x[0])) for x in csv.DictReader(fd)] | ||||
▲ Show 20 Lines • Show All 783 Lines • ▼ Show 20 Lines | partition_based_custom_selector = integer_partition_set.create_schedule_definition( | ||||
schedule_name="partition_based_custom_selector", | schedule_name="partition_based_custom_selector", | ||||
cron_schedule="0 0 * * *", | cron_schedule="0 0 * * *", | ||||
partition_selector=last_empty_partition, | partition_selector=last_empty_partition, | ||||
) | ) | ||||
@daily_schedule( | @daily_schedule( | ||||
pipeline_name="no_config_pipeline", | pipeline_name="no_config_pipeline", | ||||
start_date=today_at_midnight() - datetime.timedelta(days=1), | start_date=today_at_midnight() - datetime.timedelta(days=1), | ||||
execution_time=(datetime.datetime.now() + datetime.timedelta(hours=2)).time(), | execution_time=(get_current_datetime_in_utc() + datetime.timedelta(hours=2)).time(), | ||||
dgibson: can this just be something like time.time(hour=9, minute=30), why does it even care what time… | |||||
Done Inline Actionsi don't have any idea what this test setup is meant to be doing so i don't want to mess with the semantics max: i don't have any idea what this test setup is meant to be doing so i don't want to mess with… | |||||
) | ) | ||||
def partition_based_decorator(_date): | def partition_based_decorator(_date): | ||||
return {"storage": {"filesystem": {}}} | return {"storage": {"filesystem": {}}} | ||||
@daily_schedule( | @daily_schedule( | ||||
pipeline_name="multi_mode_with_loggers", | pipeline_name="multi_mode_with_loggers", | ||||
start_date=today_at_midnight() - datetime.timedelta(days=1), | start_date=today_at_midnight() - datetime.timedelta(days=1), | ||||
execution_time=(datetime.datetime.now() + datetime.timedelta(hours=2)).time(), | execution_time=(get_current_datetime_in_utc() + datetime.timedelta(hours=2)).time(), | ||||
mode="foo_mode", | mode="foo_mode", | ||||
) | ) | ||||
def partition_based_multi_mode_decorator(_date): | def partition_based_multi_mode_decorator(_date): | ||||
return {"storage": {"filesystem": {}}} | return {"storage": {"filesystem": {}}} | ||||
@hourly_schedule( | @hourly_schedule( | ||||
pipeline_name="no_config_chain_pipeline", | pipeline_name="no_config_chain_pipeline", | ||||
start_date=today_at_midnight() - datetime.timedelta(days=1), | start_date=today_at_midnight() - datetime.timedelta(days=1), | ||||
execution_time=(datetime.datetime.now() + datetime.timedelta(hours=2)).time(), | execution_time=(get_current_datetime_in_utc() + datetime.timedelta(hours=2)).time(), | ||||
solid_selection=["return_foo"], | solid_selection=["return_foo"], | ||||
) | ) | ||||
def solid_selection_hourly_decorator(_date): | def solid_selection_hourly_decorator(_date): | ||||
return {"storage": {"filesystem": {}}} | return {"storage": {"filesystem": {}}} | ||||
@daily_schedule( | @daily_schedule( | ||||
pipeline_name="no_config_chain_pipeline", | pipeline_name="no_config_chain_pipeline", | ||||
start_date=today_at_midnight() - datetime.timedelta(days=2), | start_date=today_at_midnight() - datetime.timedelta(days=2), | ||||
execution_time=(datetime.datetime.now() + datetime.timedelta(hours=3)).time(), | execution_time=(get_current_datetime_in_utc() + datetime.timedelta(hours=3)).time(), | ||||
solid_selection=["return_foo"], | solid_selection=["return_foo"], | ||||
) | ) | ||||
def solid_selection_daily_decorator(_date): | def solid_selection_daily_decorator(_date): | ||||
return {"storage": {"filesystem": {}}} | return {"storage": {"filesystem": {}}} | ||||
@monthly_schedule( | @monthly_schedule( | ||||
pipeline_name="no_config_chain_pipeline", | pipeline_name="no_config_chain_pipeline", | ||||
start_date=(today_at_midnight() - datetime.timedelta(days=100)).replace(day=1), | start_date=(today_at_midnight() - datetime.timedelta(days=100)).replace(day=1), | ||||
execution_time=(datetime.datetime.now() + datetime.timedelta(hours=4)).time(), | execution_time=(get_current_datetime_in_utc() + datetime.timedelta(hours=4)).time(), | ||||
solid_selection=["return_foo"], | solid_selection=["return_foo"], | ||||
) | ) | ||||
def solid_selection_monthly_decorator(_date): | def solid_selection_monthly_decorator(_date): | ||||
return {"storage": {"filesystem": {}}} | return {"storage": {"filesystem": {}}} | ||||
@weekly_schedule( | @weekly_schedule( | ||||
pipeline_name="no_config_chain_pipeline", | pipeline_name="no_config_chain_pipeline", | ||||
start_date=today_at_midnight() - datetime.timedelta(days=50), | start_date=today_at_midnight() - datetime.timedelta(days=50), | ||||
execution_time=(datetime.datetime.now() + datetime.timedelta(hours=5)).time(), | execution_time=(get_current_datetime_in_utc() + datetime.timedelta(hours=5)).time(), | ||||
solid_selection=["return_foo"], | solid_selection=["return_foo"], | ||||
) | ) | ||||
def solid_selection_weekly_decorator(_date): | def solid_selection_weekly_decorator(_date): | ||||
return {"storage": {"filesystem": {}}} | return {"storage": {"filesystem": {}}} | ||||
# Schedules for testing the user error boundary | # Schedules for testing the user error boundary | ||||
@daily_schedule( | @daily_schedule( | ||||
pipeline_name="no_config_pipeline", | pipeline_name="no_config_pipeline", | ||||
▲ Show 20 Lines • Show All 169 Lines • Show Last 20 Lines |
can this just be something like time.time(hour=9, minute=30), why does it even care what time it is now