Skip to content

Commit

Permalink
Render asset check description with the Description component (#25765)
Browse files Browse the repository at this point in the history
## Summary & Motivation

This closes #23829 and makes
the rendering of the `asset_check` description the same as `asset`
description

## How I Tested These Changes

Ran locally with the following definitions file and checked the
description rendering in the asset, asset_check with description, and
asset_check without description:

```
from dagster import Definitions, asset_check, asset

@asset
def my_asset():
    """ A simple asset with a docstring
    
    And some more text

    """
    return None

@asset_check(asset=my_asset)
def my_asset_check():
    """ Asset check for my_asset

    With a docstring

    With some more text
    """
    return None

@asset_check(asset=my_asset)
def my_asset_check2():
    return None

defs = Definitions(
    assets=[my_asset],
    asset_checks=[my_asset_check, my_asset_check2],
)
```

The result in the UI looks like this:
<img width="653" alt="image"
src="https://github.com/user-attachments/assets/dbf1acb7-f02f-400b-95ed-b034a1055fcc">
  • Loading branch information
marijncv authored Nov 8, 2024
1 parent 8a72ba5 commit 385f9dc
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,11 @@ export const AssetChecks = ({
arrowSide="right"
>
<Box padding={{top: 12}} flex={{gap: 12, direction: 'column'}}>
<Body2>
{selectedCheck.description ?? (
<Caption color={Colors.textLight()}>No description provided</Caption>
)}
</Body2>
{selectedCheck.description ? (
<Description description={selectedCheck.description} maxHeight={260} />
) : (
<Caption color={Colors.textLight()}>No description provided</Caption>
)}
{/* {selectedCheck.dependencies?.length ? (
<Box flex={{direction: 'row', gap: 6}}>
{assetNode.dependencies.map((dep) => {
Expand Down

1 comment on commit 385f9dc

@github-actions
Copy link

Choose a reason for hiding this comment

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

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-ed55ayh8b-elementl.vercel.app

Built with commit 385f9dc.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.