Skip to content

Commit

Permalink
move code blocks out
Browse files Browse the repository at this point in the history
  • Loading branch information
PedramNavid committed Aug 14, 2024
1 parent c7425c7 commit 893fe07
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 22 deletions.
Empty file.
26 changes: 4 additions & 22 deletions docs/docs-next/docs/guides/automation.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ To make creating cron expressions easier, you can use an online tool like [Cront
- You need to run jobs at regular intervals
- You want basic time-based automation

### Basic Schedule Example

<CodeExample filePath="guides/automation/simple-schedule-example.py" language="python" title="Simple Schedule Example" />

For more examples of schedules, see the [How-To Use Schedules](/guides/automation/schedules) guide.
For examples of how to create schedules, see the [How-To Use Schedules](/guides/automation/schedules) guide.

For more information about how Schedules work, see the [About Schedules](/concepts/schedules) concept page.

Expand All @@ -75,20 +71,9 @@ You must provide a function that the sensor will use to determine if it should t
- You need event-driven automation
- You want to react to changes in external systems

### Basic Sensor Example

This example includes a `check_for_new_files` function that simulates finding new files. In a real scenario, this function would check an actual system or directory.

The sensor runs every 5 seconds. If it finds new files, it starts a run of `my_job`. If not, it skips the run and logs "No new files found" in the Dagster UI.
For more examples of how to create sensors, see the [How-To Use Sensors](/guides/automation/sensors) guide.

<CodeExample filePath="guides/automation/simple-sensor-example.py" language="python" title="Simple Sensor Example" />

:::tip

By default, sensors aren't enabled when first deployed to a Dagster instance.
Click "Automation" in the top navigation to find and enable a sensor.

:::
For more information about how Sensors work, see the [About Sensors](/concepts/sensors) concept page.

## Asset Sensors

Expand All @@ -99,11 +84,8 @@ Asset Sensors trigger jobs when specified assets are materialized, allowing you
- You need to trigger jobs based on asset materializations
- You want to create dependencies between different jobs or code locations

### Basic Asset Sensor Example

<CodeExample filePath="guides/automation/simple-asset-sensor-example.py" language="python" title="Simple Asset Sensor Example" />
For more examples of how to create asset sensors, see the [How-To Use Asset Sensors](/guides/automation/asset-sensors) guide.

This Asset Sensor will trigger a run of `my_job` whenever the `asset_to_watch` asset is materialized.

## Choosing the Right Automation Method

Expand Down
5 changes: 5 additions & 0 deletions docs/docs-next/docs/guides/automation/asset-sensors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Basic Asset Sensor Example

<CodeExample filePath="guides/automation/simple-asset-sensor-example.py" language="python" title="Simple Asset Sensor Example" />

This Asset Sensor will trigger a run of `my_job` whenever the `asset_to_watch` asset is materialized.
7 changes: 7 additions & 0 deletions docs/docs-next/docs/guides/automation/schedules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Basic Schedule Example

<CodeExample filePath="guides/automation/simple-schedule-example.py" language="python" title="Simple Schedule Example" />

For more examples of schedules, see the [How-To Use Schedules](/guides/automation/schedules) guide.

For more information about how Schedules work, see the [About Schedules](/concepts/schedules) concept page.
14 changes: 14 additions & 0 deletions docs/docs-next/docs/guides/automation/sensors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### Basic Sensor Example

This example includes a `check_for_new_files` function that simulates finding new files. In a real scenario, this function would check an actual system or directory.

The sensor runs every 5 seconds. If it finds new files, it starts a run of `my_job`. If not, it skips the run and logs "No new files found" in the Dagster UI.

<CodeExample filePath="guides/automation/simple-sensor-example.py" language="python" title="Simple Sensor Example" />

:::tip

By default, sensors aren't enabled when first deployed to a Dagster instance.
Click "Automation" in the top navigation to find and enable a sensor.

:::

0 comments on commit 893fe07

Please sign in to comment.