Skip to content

Fix: Handle InputDefinition objects when mapping asset specs#32953

Merged
OwenKephart merged 2 commits intodagster-io:masterfrom
Jongwan93:issue-32913
Dec 15, 2025
Merged

Fix: Handle InputDefinition objects when mapping asset specs#32953
OwenKephart merged 2 commits intodagster-io:masterfrom
Jongwan93:issue-32913

Conversation

@Jongwan93
Copy link
Copy Markdown
Contributor

@Jongwan93 Jongwan93 commented Dec 3, 2025

Fixes #32913

Summary & Motivation

This PR resolves an AttributeError that occurred when using the dagster.map_asset_specs utility on an asset defined using the explicit ins parameter.

The issue occurred during the reconstruction of the asset's underlying OpDefinition. When inputs were sourced from the existing OpDefinition, they were already fully converted InputDefinition objects. However, the OpDefinition.__init__ logic expected user-facing In objects and attempted to call the .to_definition() method on the already converted InputDefinition object.

How I Tested These Changes

I created a new regression test case, test_map_asset_specs_asset_with_ins_regression, within the test_asset_spec.py file.

  1. Before Fix: The regression test failed with an AttributeError, confirming the issue.
  2. After Fix: The test case runs successfully and verifies that both existing and added dependencies are correctly mapped, proving the OpDefinition reconstruction now works correctly for assets with explicit ins.

Changelog

Fixes an AttributeError when calling map_asset_specs on assets defined using the ins parameter.

@danielgafni
Copy link
Copy Markdown
Contributor

@cmpadden @OwenKephart could you please take a look at this one? 🙏

I need it for Metaxy :)

This resolves an AttributeError in OpDefinition.__init__ when assets defined
with explicit `ins={...}` are passed through `map_asset_specs`.

The fix ensures that InputDefinition objects are correctly identified and
not unnecessarily sent through a conversion method.

Includes regression test.
Copy link
Copy Markdown
Contributor

@OwenKephart OwenKephart left a comment

Choose a reason for hiding this comment

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

thanks for fixing this!

@OwenKephart OwenKephart merged commit 848d6dd into dagster-io:master Dec 15, 2025
1 check failed
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.

[core] AssetsDefinition.map_asset_specs fails when attempting to add deps with ins set

3 participants