From a691ff8da05b84685073ffac2e94c2d140d0441a Mon Sep 17 00:00:00 2001 From: anuunchin Date: Tue, 7 May 2024 15:47:37 +0200 Subject: [PATCH] Code snippet fixed --- .../blog/2024-05-07-on-orchestrators.md | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/website/blog/2024-05-07-on-orchestrators.md b/docs/website/blog/2024-05-07-on-orchestrators.md index b1667a4eaa..1546b7ffe8 100644 --- a/docs/website/blog/2024-05-07-on-orchestrators.md +++ b/docs/website/blog/2024-05-07-on-orchestrators.md @@ -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.