Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use AssetExecutionContext to correctly pass in StravaAPIResource #11

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: update StravaResourceAPI to actually be used as a resource in Da…
…gster
jairus-m committed Dec 23, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 83467a83216dc6b887d1de62648129757817703d
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
@@ -2,6 +2,7 @@
asset,
EnvVar,
get_dagster_logger,
AssetExecutionContext,
)
import dlt
from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources
@@ -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
@@ -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.