Skip to content

Type asset_expression on the API side so the UI doesn't cast through unknown #67692

Closed

Description

@Lee-W

Body

The UI endpoints that return asset_expression declare it as dict | None on the Python datamodel — datamodels/dags.py, datamodels/ui/dags.py, datamodels/ui/assets.py, datamodels/ui/partitioned_dag_runs.py. OpenAPI gen turns this into { [k: string]: unknown } | null in the generated TypeScript, so the UI hand-writes an ExpressionType discriminated union in src/components/AssetExpression/ and the consumers (AssetProgressCell.tsx, pages/DagsList/AssetSchedule.tsx) cast unknown as ExpressionType with no runtime check.

If the server-side shape ever changes the TypeScript build won't catch it — the failure mode is a blank render or a discriminator-missing crash at runtime.

from #64571 (comment)

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.

Activity

  1. added
    kind:meta
    on May 29, 2026
  2. added
    area:UI
    kind:feature
    on May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:UIkind:featurekind:meta

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions