[dagster-dbt][refactor] Clean up multi-asset creation #26614
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary & Motivation
We have a bunch of complex logic going on here, purely because we are not taking advantage of the features around passing specs into @multi_asset
Crucially, before this change, we were manually creating internal_asset_deps, AssetIns, and AssetOuts independently, alongside juggling a bunch of different dictionaries to keep track of it all.
Now, I've created a single
get_asset_spec
method. Once we're ready, this can essentially be copy-pasted into the DagsterDbtTranslator class once we're ready, but for now this is purely-internal construct.The only change in the constructed object is that we no longer have control over the generated output names for each key, and instead they are automatically generated using AssetKey.to_python_identifier. This is the cause of the updated tests.
I judge this is totally fine -- the output names are not actually user-facing in this context, it's just framework code that needs to handle this mapping (and this framework code actually gets a bit nicer as well)
How I Tested These Changes
Changelog
NOCHANGELOG