Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code block formatting in automations concepts docs #13959

Merged
merged 3 commits into from
Jun 12, 2024

Conversation

collincchoy
Copy link
Contributor

@collincchoy collincchoy commented Jun 12, 2024

This PR includes minor tweaks to code blocks within the concepts/automations docs page.

  • fixes indentation/formatting in python blocks
  • specifies json/yaml for code fences where relevant rather than python

PR for 2.x - #13962

@collincchoy collincchoy requested a review from a team as a code owner June 12, 2024 14:55
Comment on lines -99 to -107
expect={"animal.walked"},
match={
"genus": "Marmota",
"species": "monax",
expect={"animal.walked"},
match={
"genus": "Marmota",
"species": "monax",
},
posture="Reactive",
threshold=3,
),
actions=[CancelFlowRun()]
Copy link
Contributor Author

@collincchoy collincchoy Jun 12, 2024

Choose a reason for hiding this comment

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

This previously looks like actions is part of the trigger rather than being a sibling

@@ -171,7 +169,7 @@ Both the `event` and `metric` triggers support matching events for specific reso

Consider the `resource` and `related` fields on the following `prefect.flow-run.Completed` event, truncated for the sake of example. Its primary resource is a flow run, and since that flow run was started via a deployment, it is related to both its flow and its deployment:

```python
```json
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wondering if this'll render any better/differently 🤔

as-is works fine except in one block further down where // is used as comments but the block is marked as python.

tho json usually doesn't actually support comments so idk how mintlify will render those as JSON either.

Copy link
Contributor

Choose a reason for hiding this comment

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

Lets try it and see how it looks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah i just noticed while making changes for 2.x these were previously already json/yaml/bash in 2.x. 🤔 wonder if there was a reason these changed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

rah the preview's blocks look much better to me! 👍

not sure why these would've all changed to python when they were moved over 🤷

Comment on lines +277 to +290
table = Table(table_name)

if not table.exists():
emit_event(
event="table-missing",
resource={"prefect.resource.id": "etl-events.transform"}
)
elif table.is_empty():
emit_event(
event="table-empty",
resource={"prefect.resource.id": "etl-events.transform"}
if not table.exists():
emit_event(
event="table-missing",
resource={"prefect.resource.id": "etl-events.transform"}
)
else:
# transform data

elif table.is_empty():
emit_event(
event="table-empty",
resource={"prefect.resource.id": "etl-events.transform"}
)
else:
# transform data
Copy link
Contributor Author

Choose a reason for hiding this comment

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

2 spaces -> 4 spaces

for consistency w/ rest of the page's python blocks.

@collincchoy collincchoy merged commit 4f84fff into main Jun 12, 2024
4 checks passed
@collincchoy collincchoy deleted the formatting-in-automations-concepts-docs branch June 12, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants