Skip to content

Commit

Permalink
[docs] fix dynamic graph examples (#7174)
Browse files Browse the repository at this point in the history
fixes #7173



## Test Plan

eyes
  • Loading branch information
alangenfeld committed Mar 23, 2022
1 parent 070610d commit a3b44e7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/content/concepts/ops-jobs-graphs/dynamic-graphs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ def load_pieces():

Then after creating ops for our downstream operations, we can put them all together in a job.

```python file=/concepts/solids_pipelines/dynamic.py startafter=dyn_out_start endbefore=dyn_out_end
@op(out=DynamicOut())
def load_pieces():
large_data = load_big_data()
for idx, piece in large_data.chunk():
yield DynamicOutput(piece, mapping_key=idx)
```python file=/concepts/solids_pipelines/dynamic.py startafter=dyn_job_start endbefore=dyn_job_end
@job
def dynamic_graph():
pieces = load_pieces()
results = pieces.map(compute_piece)
merge_and_analyze(results.collect())
```

Within our `@job` decorated composition function, the object representing the dynamic output can not be passed directly to another op. Either `map` or `collect` must be invoked on it.
Expand Down

1 comment on commit a3b44e7

@vercel
Copy link

@vercel vercel bot commented on a3b44e7 Mar 23, 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.