34 lines
841 B
Python
34 lines
841 B
Python
from dagster import (
|
|
Definitions,
|
|
load_assets_from_modules,
|
|
EnvVar,
|
|
DefaultSensorStatus,
|
|
AutomationConditionSensorDefinition
|
|
)
|
|
from dagster_duckdb import DuckDBResource
|
|
|
|
import assets
|
|
from resources import MobilityDatabaseAPI
|
|
|
|
all_assets = load_assets_from_modules([assets])
|
|
|
|
defs = Definitions(
|
|
assets=all_assets,
|
|
sensors=[
|
|
AutomationConditionSensorDefinition(
|
|
"asset_automation_sensor",
|
|
target="*",
|
|
default_status=DefaultSensorStatus.RUNNING,
|
|
),
|
|
assets.gtfs_rt_vehicles_sensor
|
|
],
|
|
resources={
|
|
"duckdb": DuckDBResource(
|
|
database="data/duckdb/gtfs.duckdb"
|
|
),
|
|
"mobility_db": MobilityDatabaseAPI(
|
|
refresh_token=EnvVar("MOBILITY_DB_REFRESH_TOKEN"),
|
|
rate_limit_delay=0.5
|
|
)
|
|
}
|
|
)
|