dagster
dagster copied to clipboard
simplify multi-asset sensor examples and fix formatting
Summary & Motivation
I was reading the multi-asset doc on the sensors concept page when working on using it inside the hacker news example, and I thought there was opportunity to simplify the first example and make the second example more realistic.
I also noticed this list formatting issue, which seems to get caused when PyObject tags are the first entry in a list:

How I Tested These Changes
Looked at them in the docs site.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated |
---|---|---|---|---|
dagster | ✅ Ready (Inspect) | Visit Preview | 💬 Add your feedback | Sep 28, 2022 at 8:57PM (UTC) |
@yuhan The mdx-format
script strikes again -.- Perhaps it's worthwhile for us to spend some time hammering on this script so we're not always playing whack-a-mole with it?
There are a few things happening here - if a PyObject
has more than one property, the mdx-format
script will format the code on multiple lines only if it isn't preceded by other characters. PyObjects
with a single property remain inline when the script is run, regardless of whether they're first in a list item.
Ex:
## This:
- <PyObject object="MultiAssetSensorEvaluationContext" method="latest_materialization_records_by_key" /> [text_here]
## Results in:
- <PyObject
object="MultiAssetSensorEvaluationContext"
method="latest_materialization_records_by_key"
/> [text_here]
Which is causing the weird formatting / line splits reported by Sandy in this issue.
But the following won't be touched, remaining inline as intended:
- [text_here] <PyObject object="MultiAssetSensorEvaluationContext" method="latest_materialization_records_by_key" /> [text_here]