Skip to content

Commit

Permalink
Code snippet fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
anuunchin committed May 7, 2024
1 parent f4cec02 commit a691ff8
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions docs/website/blog/2024-05-07-on-orchestrators.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,34 +128,34 @@ In the `resources` folder, the following two Dagster resources are defined as

```python
class DltPipeline(ConfigurableResource):
# Initialize resource with pipeline details
pipeline_name: str
dataset_name: str
destination: str
# Initialize resource with pipeline details
pipeline_name: str
dataset_name: str
destination: str

def create_pipeline(self, resource_data, table_name):
"""
Creates and runs a dlt pipeline with specified data and table name.
Args:
resource_data: The data to be processed by the pipeline.
table_name: The name of the table where data will be loaded.
Returns:
The result of the pipeline execution.
"""
# Configure the dlt pipeline with your destination details
pipeline = dlt.pipeline(
pipeline_name=self.pipeline_name,
destination=self.destination,
dataset_name=self.dataset_name
)
# Run the pipeline with your parameters
load_info = pipeline.run(resource_data, table_name=table_name)
return load_info
def create_pipeline(self, resource_data, table_name):
"""
Creates and runs a dlt pipeline with specified data and table name.
Args:
resource_data: The data to be processed by the pipeline.
table_name: The name of the table where data will be loaded.
Returns:
The result of the pipeline execution.
"""

# Configure the dlt pipeline with your destination details
pipeline = dlt.pipeline(
pipeline_name=self.pipeline_name,
destination=self.destination,
dataset_name=self.dataset_name
)

# Run the pipeline with your parameters
load_info = pipeline.run(resource_data, table_name=table_name)
return load_info

```

2. `LocalFileStorage`: Manages the local file storage, ensuring the storage directory exists and allowing data to be written to files within it. It will be later used in our Dagster assets to save images into the `charts` folder.
Expand Down

0 comments on commit a691ff8

Please sign in to comment.