Skip to content

Commit

Permalink
[components][docs] Change evaluate to execute, fix link (#27259)
Browse files Browse the repository at this point in the history
## Summary & Motivation

as title

## How I Tested These Changes

## Changelog

NOCHANGELOG
  • Loading branch information
OwenKephart authored Jan 22, 2025
1 parent 37149ab commit 0b5f237
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ To do so, there are two methods that need to be overridden:

In our case, our `load` method will check the loaded parameters against our schema and then instantiate our class from those parameters.

Our `build_defs` method will create a single `@asset` that executes the provided shell script. By convention, we'll put the code to actually execute this asset inside of a function called `evaluate`. This makes it easier for future developers to create subclasses of this component.
Our `build_defs` method will create a single `@asset` that executes the provided shell script. By convention, we'll put the code to actually execute this asset inside of a function called `execute`. This makes it easier for future developers to create subclasses of this component.

<CodeExample path="docs_beta_snippets/docs_beta_snippets/guides/components/shell-script-component/with-build-defs.py" language="python" />

Expand Down
2 changes: 1 addition & 1 deletion docs/docs-beta/docs/guides/build/components/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ $ duckdb /tmp/jaffle_platform.duckdb -c "SELECT * FROM raw_customers LIMIT 5;"
We'll now download a pre-existing sample DBT project from github. We're going to use the data we are ingesting with Sling as an input for the DBT project. Clone the project (and delete the embedded git repo):
```bash
$ git clone --depth=1 https://github.com/dagster-io/jaffle_platform.git dbt && rm -rf dbt/.git
$ git clone --depth=1 https://github.com/dagster-io/jaffle-platform.git dbt && rm -rf dbt/.git
```
We'll need to create a Dagster DBT project component to interface with the dbt project. We can access the DBT project component by installing `dagster-components[dbt]` and `dbt-duckdb`:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ def build_defs(self, load_context: ComponentLoadContext) -> dg.Definitions:

@dg.asset(**resolved_asset_attributes, **resolved_op_properties)
def _asset(context: dg.AssetExecutionContext):
self.evaluate(context)
self.execute(context)

return dg.Definitions(assets=[_asset])

def evaluate(self, context: dg.AssetExecutionContext):
def execute(self, context: dg.AssetExecutionContext):
subprocess.run(["sh", self.params.script_path], check=False)

1 comment on commit 0b5f237

@github-actions
Copy link

@github-actions github-actions bot commented on 0b5f237 Jan 22, 2025

Choose a reason for hiding this comment

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

Deploy preview for dagster-docs-beta ready!

✅ Preview
https://dagster-docs-beta-qi6tvbwlf-elementl.vercel.app

Built with commit 0b5f237.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.