Skip to content

Latest commit

 

History

History
43 lines (37 loc) · 901 Bytes

step-5-automation.md

File metadata and controls

43 lines (37 loc) · 901 Bytes

Step 5: Automation

Set the auto materialization policy to CRON for the raw data asset

schedule = ScheduleDefinition(
    name="schedule",
    target=AssetSelection.assets(["ames_housing_data"]),
    cron_schedule="*/2 * * * *",
    default_status=DefaultScheduleStatus.RUNNING,
)

definitions = Definitions(
    ...
    schedules=[schedule],
)
@asset(
    io_manager_key="csv_io_manager",
    automation_condition=AutomationCondition.eager(),
)
@multi_asset(
    outs={
        "train_data": AssetOut(
            io_manager_key="csv_io_manager",
            automation_condition=AutomationCondition.eager(),
        ),
        "test_data": AssetOut(
            io_manager_key="csv_io_manager",
            automation_condition=AutomationCondition.eager(),
        ),
    },
)
@asset(automation_condition=AutomationCondition.eager())