From 8b50aa5fbd133374bc5876a556af6355ce48aec1 Mon Sep 17 00:00:00 2001 From: Erin Cochran Date: Tue, 30 Jan 2024 17:19:07 -0500 Subject: [PATCH 1/2] Fix dupe copy in Lesson 1 --- ...asset-centric-orchestration-good-for-data-engineering.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/dagster-university/pages/dagster-essentials/lesson-1/why-is-asset-centric-orchestration-good-for-data-engineering.md b/docs/dagster-university/pages/dagster-essentials/lesson-1/why-is-asset-centric-orchestration-good-for-data-engineering.md index 4bfa7fde055a3..55de849cd5a5b 100644 --- a/docs/dagster-university/pages/dagster-essentials/lesson-1/why-is-asset-centric-orchestration-good-for-data-engineering.md +++ b/docs/dagster-university/pages/dagster-essentials/lesson-1/why-is-asset-centric-orchestration-good-for-data-engineering.md @@ -6,11 +6,7 @@ lesson: '1' # Why is asset-centric orchestration good for data engineering? -In a task-centric world, it can be difficult to tell how an asset is produced, whether it’s up-to-date, and how it relates to other assets. Decoupling tasks from assets is necessary not only to troubleshoot issues when they arise, but to come to a basic understanding of the workflow. - -On the other hand, an asset-centric workflow puts the focus on the data that’s produced rather than how it’s produced. This can make it easy to determine how a change could impact other assets and allow stakeholders to understand how their data is produced. - -Let’s go back to our cookie example and take a look at what different situations might look like for both a task-centric and asset-centric approach. +To answer this question, let’s go back to our cookie example and take a look at what different situations might look like for both a task-centric and asset-centric approach. --- From baf9a09009befae36a08dc9b8c58f73eb3b46810 Mon Sep 17 00:00:00 2001 From: Erin Cochran Date: Tue, 30 Jan 2024 17:24:44 -0500 Subject: [PATCH 2/2] Fix indentation in Sensor examples --- .../lesson-9/building-the-sensor.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/dagster-university/pages/dagster-essentials/lesson-9/building-the-sensor.md b/docs/dagster-university/pages/dagster-essentials/lesson-9/building-the-sensor.md index 83bcfbe698c2c..719be3addbf0e 100644 --- a/docs/dagster-university/pages/dagster-essentials/lesson-9/building-the-sensor.md +++ b/docs/dagster-university/pages/dagster-essentials/lesson-9/building-the-sensor.md @@ -40,7 +40,7 @@ Now that cursors have been explained, let’s start writing the sensor. ```python from dagster import ( RunRequest, - SensorResult, + SensorResult, sensor ) @@ -132,10 +132,14 @@ Now that cursors have been explained, let’s start writing the sensor. )) ``` - - Using `os.listdir` , iterate through the `data/requests` directory, look at every JSON file, and see if it’s been updated or looked at it before in `previous_state` - - If the file has been updated or a report hasn’t been run before, create a `RunRequest` for the file - - Construct a unique `run_key`, which includes the name of the file and when it was last modified - - Pass the `run_key` into the `RunRequest`'s configuration using the `run_config` argument. By using the `adhoc_request` key, you specify that the `adhoc_request` asset should use the config provided. + **Note**: When pasting this into the sensor, verify that the indentation is correct or you'll encounter a Python error. + + This example: + + - Uses `os.listdir` to iterate through the `data/requests` directory, looking at every JSON file, and seeing if it’s been updated or looked at it before in `previous_state` + - Creates a `RunRequest` for the file if it's been updated or a report hasn’t been run before + - Constructs a unique `run_key`, which includes the name of the file and when it was last modified + - Passes the `run_key` into the `RunRequest`'s configuration using the `run_config` argument. By using the `adhoc_request` key, you specify that the `adhoc_request` asset should use the config provided. 9. Sensors expect a `SensorResult` returned, which contains all the information for the sensor, such as which runs to trigger and what the new cursor is. Append the following to the end of the sensor function: