Skip to content

Commit

Permalink
[docstring] Replace inexistent object DltDagsterResource by `Dagste…
Browse files Browse the repository at this point in the history
…rDltResource` (#26518)

## Summary & Motivation

While going through the [API reference docs
](https://docs.dagster.io/_apidocs/libraries/dagster-embedded-elt#dlt-dagster-embedded-elt-dlt)
I found code errors and it didn't match [the code snippet from the
integration page](https://dagster.io/integrations/dagster-dlt).

Searching the codebase for `dltdagster`, results were only found for
this file while `dagsterdlt` had results in ~13 files.

I modified the code snippet found in the docstring.

## How I Tested These Changes

No test were conducted.
  • Loading branch information
zilto authored Dec 16, 2024
1 parent 7cf69b9 commit bf640e8
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,17 @@ def dlt_assets(
dlt_pipeline (Pipeline): The dlt Pipeline defining the destination parameters.
name (Optional[str], optional): The name of the op.
group_name (Optional[str], optional): The name of the asset group.
dagster_dlt_translator (DltDagsterTranslator, optional): Customization object for defining asset parameters from dlt resources.
dagster_dlt_translator (DagsterDltTranslator, optional): Customization object for defining asset parameters from dlt resources.
Examples:
Loading Hubspot data to Snowflake with an auto materialize policy using the dlt verified source:
.. code-block:: python
class HubspotDltDagsterTranslator(DltDagsterTranslator):
from dagster_embedded_elt.dlt import DagsterDltResource, DagsterDltTranslator, dlt_assets
class HubspotDagsterDltTranslator(DagsterDltTranslator):
@public
def get_auto_materialize_policy(self, resource: DltResource) -> Optional[AutoMaterializePolicy]:
return AutoMaterializePolicy.eager().with_rules(
Expand All @@ -100,15 +103,18 @@ def get_auto_materialize_policy(self, resource: DltResource) -> Optional[AutoMat
),
name="hubspot",
group_name="hubspot",
dagster_dlt_translator=HubspotDltDagsterTranslator(),
dagster_dlt_translator=HubspotDagsterDltTranslator(),
)
def hubspot_assets(context: AssetExecutionContext, dlt: DltDagsterResource):
def hubspot_assets(context: AssetExecutionContext, dlt: DagsterDltResource):
yield from dlt.run(context=context)
Loading Github issues to snowflake:
.. code-block:: python
from dagster_embedded_elt.dlt import DagsterDltResource, dlt_assets
@dlt_assets(
dlt_source=github_reactions(
"dagster-io", "dagster", items_per_page=100, max_items=250
Expand All @@ -122,7 +128,7 @@ def hubspot_assets(context: AssetExecutionContext, dlt: DltDagsterResource):
name="github",
group_name="github",
)
def github_reactions_dagster_assets(context: AssetExecutionContext, dlt: DltDagsterResource):
def github_reactions_dagster_assets(context: AssetExecutionContext, dlt: DagsterDltResource):
yield from dlt.run(context=context)
"""
Expand Down

0 comments on commit bf640e8

Please sign in to comment.