Skip to content

[webserver] Accept user-provided tags on the report_asset_materialization and report_asset_observation REST endpoints#33919

Draft
raghav-reglobe wants to merge 1 commit into
dagster-io:masterfrom
raghav-reglobe:report-asset-materialization-tags
Draft

[webserver] Accept user-provided tags on the report_asset_materialization and report_asset_observation REST endpoints#33919
raghav-reglobe wants to merge 1 commit into
dagster-io:masterfrom
raghav-reglobe:report-asset-materialization-tags

Conversation

@raghav-reglobe

@raghav-reglobe raghav-reglobe commented Jun 10, 2026

Copy link
Copy Markdown

Summary & Motivation

DagsterInstance.report_runless_asset_event supports arbitrary event tags via AssetMaterialization(tags=...) / AssetObservation(tags=...) — but the /report_asset_materialization/ and /report_asset_observation/ REST endpoints accept only their allowlisted params and silently drop everything else. External writers in non-Python languages (JVM/Go services reporting events for external assets over REST) therefore cannot attach data-version provenance tags such as dagster/input_data_version/<upstream> / dagster/code_version, which are exactly what makes externally-materialized assets participate in data-version/staleness machinery.

This adds an optional tags parameter to both endpoints:

  • JSON body object, or json-encoded query param — mirroring the existing metadata handling (including the 400 on parse failure), plus a 400 when tags is not a json object.
  • No new validation surface: tags flow into the existing event construction, where validate_asset_event_tags already exempts system asset-event tags and strict-validates the rest; failures surface through the endpoints' existing 400 path.
  • The dedicated data_version param takes precedence over a conflicting dagster/data_version tag (user tags merge first, param applies after).
  • ReportAssetMatParam / ReportAssetObsParam gain tags; the materialization API-consistency test's KNOWN_DIFF documents that Pipes does not take tags (same as partition/description).
  • Drive-by: fixes a copy-paste typo in the observation handler's construction-error message (it said "Error constructing AssetMaterialization").

Asset checks are intentionally left out — ReportAssetCheckEvalParam has a different shape (severity/passed) and AssetCheckEvaluation has no equivalent tags concept.

Context: we currently run the materialization half as a small runtime patch in production (JVM relays report Iceberg-commit materializations for ~16K external assets with input_data_version tags); upstreaming removes the need to carry it.

Test Plan

Extended dagster_webserver_tests/webserver/test_asset_events.py:

  • materialization: tags via json body (system dagster/input_data_version/... + custom key), tags via json-encoded query param, data_version param precedence over a conflicting tag, 400 on non-json query param, 400 on non-object body tags
  • observation: tags via json body + data_version precedence, 400 on non-object tags
  • both API-consistency tests updated (sample_payload + per-key validation; materialization KNOWN_DIFF)

All 10 tests in the file pass locally.

Changelog

The /report_asset_materialization/ and /report_asset_observation/ REST endpoints now accept an optional tags parameter (json object), allowing runless asset events reported over REST to carry event tags such as data-version provenance — matching the existing Python SDK capability.

🤖 Generated with Claude Code

… + report_asset_observation

The Python SDK supports arbitrary tags on runless asset events
(AssetMaterialization/AssetObservation tags=...), but the REST endpoints
silently drop any field outside their allowlists — so external (non-Python)
writers reporting events over REST cannot attach data-version provenance
tags like dagster/input_data_version/<upstream>. This adds an optional
'tags' param to both endpoints (json body, or json-encoded query param
mirroring 'metadata' handling). Validation is unchanged: tags flow into the
existing event construction, where validate_asset_event_tags already exempts
system asset event tags and strict-validates the rest, surfacing errors via
the existing 400 path. The dedicated data_version param takes precedence
over a conflicting dagster/data_version tag. Also fixes a copy-paste typo in
the observation handler's construction-error message (said
AssetMaterialization).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@raghav-reglobe raghav-reglobe force-pushed the report-asset-materialization-tags branch from 8e7cf3a to d1d691e Compare June 10, 2026 15:27
@raghav-reglobe raghav-reglobe changed the title [webserver] Accept user-provided tags on the report_asset_materialization REST endpoint [webserver] Accept user-provided tags on the report_asset_materialization and report_asset_observation REST endpoints Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant