Skip to content

Commit

Permalink
Respond to feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrist committed Mar 31, 2021
1 parent 65646f2 commit f656f54
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
18 changes: 13 additions & 5 deletions docs/core/examples/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,26 @@ viewed live in the docs, or accessed from the GitHub repo

## Running with Prefect Cloud or Server

When running with Prefect Cloud or Prefect Server, you can register all the
examples in a new project by running the following:
When running with Prefect Cloud or Prefect Server, you can register the
examples in a new project with the Prefect CLI. You can either register all the
examples at once, or select specific examples by name.

```
# Create a new project (optional)
# Create a new project named "Prefect Examples"
$ prefect create project "Prefect Examples"
# Register all the examples into the "Prefect Examples" project
$ prefect register --json https://docs.prefect.io/examples.json --project "Prefect Examples"
$ prefect register --json https://docs.prefect.io/examples.json \
--project "Prefect Examples"
# OR register only specific examples by specifying them by name
$ prefect register --json https://docs.prefect.io/examples.json \
--project "Prefect Examples" \
--name "Example: Parameters" \
--name "Example: Mapping"
```

These can then be run using any agent with an ``prefect-examples`` label. For
These can then be run using any agent with a ``prefect-examples`` label. For
example, to start a local agent for running the examples:

```
Expand Down
2 changes: 1 addition & 1 deletion docs/generate_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ def build_example(path):

register_lines = [f"prefect register --json https://docs.prefect.io/examples.json"]
for name in sorted(flows):
register_lines.append(f" --name {name}")
register_lines.append(f" --name {name!r}")
register_lines.append(f" --project 'Prefect Examples'")

rendered = EXAMPLE_TEMPLATE.format(
Expand Down
6 changes: 3 additions & 3 deletions examples/conditional.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ def another_action(val):
cond = check_condition()

with case(cond, True):
val1 = action_if_true()
val_if_true = action_if_true()

with case(cond, False):
val2 = action_if_false()
val_if_false = action_if_false()

val = merge(val1, val2)
val = merge(val_if_true, val_if_false)

another_action(val)

Expand Down
2 changes: 1 addition & 1 deletion examples/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def print_total(x, y, total):
print(f"{x} + {y} = {total}")


with Flow("Examples: Parameters") as flow:
with Flow("Example: Parameters") as flow:
x = Parameter("x", default=1)
y = Parameter("y", default=2)

Expand Down

0 comments on commit f656f54

Please sign in to comment.