dagster icon indicating copy to clipboard operation
dagster copied to clipboard

simplify multi-asset sensor examples and fix formatting

Open sryza opened this issue 2 years ago • 1 comments

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:

image

How I Tested These Changes

Looked at them in the docs site.

sryza avatar Sep 21 '22 15:09 sryza

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)
2 Ignored Deployments
Name Status Preview Comments Updated
dagit-storybook ⬜️ Ignored (Inspect) Sep 28, 2022 at 8:57PM (UTC)
dagster-oss-cloud-consolidated ⬜️ Ignored (Inspect) Sep 28, 2022 at 8:57PM (UTC)

vercel[bot] avatar Sep 21 '22 15:09 vercel[bot]

@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]

erinkcochran87 avatar Sep 22 '22 15:09 erinkcochran87