Skip to content

Commit

Permalink
fix up reexecution api example docs (#6787)
Browse files Browse the repository at this point in the history
* fix up reexecution api example docs

* fix snapshots
  • Loading branch information
prha committed Feb 24, 2022
1 parent 4d89075 commit 82c80c3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions docs/content/guides/dagster/re-execution.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Consider the following job which has three ops, one of which fails half of the t
```python file=/guides/dagster/reexecution/unreliable_job.py
from random import random

from dagster import graph, op
from dagster import in_process_executor, job, op


@op
Expand All @@ -44,7 +44,7 @@ def end(_num: int):
pass


@graph
@job(executor_def=in_process_executor)
def unreliable_job():
end(unreliable(start()))
```
Expand Down Expand Up @@ -81,13 +81,13 @@ Re-execution can be triggered via the API as well.
Again, let's revist the job `unreliable_job`, which has a op named `unreliable`.

```python file=/guides/dagster/reexecution/reexecution_api.py endbefore=end_initial_execution_marker
from dagster import DagsterInstance, execute_pipeline, reexecute_pipeline
from dagster import DagsterInstance, reexecute_pipeline
from docs_snippets.guides.dagster.reexecution.unreliable_job import unreliable_job

instance = DagsterInstance.ephemeral()

# Initial execution
job_execution_result = execute_pipeline(unreliable_job, instance=instance)
job_execution_result = unreliable_job.execute_in_process(instance=instance, raise_on_error=False)

if not job_execution_result.success:
# re-execute the entire job
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from dagster import DagsterInstance, execute_pipeline, reexecute_pipeline
from dagster import DagsterInstance, reexecute_pipeline
from docs_snippets.guides.dagster.reexecution.unreliable_job import unreliable_job

instance = DagsterInstance.ephemeral()

# Initial execution
job_execution_result = execute_pipeline(unreliable_job, instance=instance)
job_execution_result = unreliable_job.execute_in_process(instance=instance, raise_on_error=False)

if not job_execution_result.success:
# re-execute the entire job
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from random import random

from dagster import graph, op
from dagster import in_process_executor, job, op


@op
Expand All @@ -22,6 +22,6 @@ def end(_num: int):
pass


@graph
@job(executor_def=in_process_executor)
def unreliable_job():
end(unreliable(start()))

1 comment on commit 82c80c3

@vercel
Copy link

@vercel vercel bot commented on 82c80c3 Feb 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.