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

chore: 🚚 move resources #57

Merged
merged 1 commit into from
Feb 2, 2024
Merged

chore: 🚚 move resources #57

merged 1 commit into from
Feb 2, 2024

Conversation

davidgasquez
Copy link
Owner

Spent some time moving the Dune operation to resources and set up some jobs on top of the resources.

@davidgasquez davidgasquez self-assigned this Feb 2, 2024
dbt_resource = dbt_cli_resource.configured(
{"project_dir": DBT_PROJECT_DIR, "profiles_dir": DBT_PROJECT_DIR}
)
dbt_resource = DbtCliResource(project_dir=DBT_PROJECT_DIR, profiles_dir=DBT_PROJECT_DIR)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the non-deprecated way to access dbt from Dagster these days.


resources = {
"covalent_api": res.CovalentAPIResource(API_KEY=EnvVar("COVALENT_API_KEY")),
"dune": res.DuneResource(DUNE_API_KEY=EnvVar("DUNE_API_KEY")),
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we can reuse the logic across assets!

Comment on lines +176 to +183
@asset(compute_kind="API", group_name="private_api")
def dune_allo_deployments(
dune: DuneResource, raw_allo_deployments: pd.DataFrame
) -> None:
"""
Uploads allo deployments to Dune.
"""
dune.upload_csv(raw_allo_deployments, "allo_contract_deployments")
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could potentially be a multi-asset that loops over assets tagges with curated or another tag.

@davidgasquez davidgasquez merged commit 0a12ec4 into main Feb 2, 2024
1 check passed
@davidgasquez davidgasquez deleted the move-resources branch February 2, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant