Skip to content

Commit

Permalink
Merge pull request #11 from jairus-m/feat/strava-resource-v3
Browse files Browse the repository at this point in the history
Use AssetExecutionContext to correctly pass in StravaAPIResource
  • Loading branch information
jairus-m authored Dec 23, 2024
2 parents a4dc220 + 83467a8 commit 4f885a0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion analytics_dbt/target/manifest.json

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions dagster_proj/assets/activities.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
asset,
EnvVar,
get_dagster_logger,
AssetExecutionContext,
)
import dlt
from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources
Expand Down Expand Up @@ -52,8 +53,12 @@ def strava_rest_api_config(strava_resource: StravaAPIResource):
yield from rest_api_resources(config)


@asset(key=["strava", "activities"], group_name="dltHub")
def load_strava_activities():
@asset(
key=["strava", "activities"],
group_name="dltHub",
required_resource_keys={"strava"},
)
def load_strava_activities(context: AssetExecutionContext):
"""
dlt EL pipeline based off declarative Rest API Config
to load raw Strava activities into DuckDB
Expand All @@ -70,7 +75,7 @@ def load_strava_activities():
progress="log",
)

source = strava_rest_api_config(strava_api_resouce)
source = strava_rest_api_config(context.resources.strava)

load_info = pipeline.run(source)
logger.info(load_info)
Binary file modified data/dev/strava.duckdb
Binary file not shown.

0 comments on commit 4f885a0

Please sign in to comment.