Proper use of @graph_multi_asset? #28566
Unanswered
stalerik95
asked this question in
Q&A
Replies: 1 comment
-
I have the same issue. Would be great to have better examples for |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there!
I'm new to Dagster, am developing a solution combining it with dbt. I want a multi-asset that materializes all assets for a dbt source (a collection of tables, presumed to exist by the dbt project). I'd like to be able to materialize a subset of the assets, wherefore I need access to the execution context and
context.selected_asset_keys
. I've understood this cannot be done neither within@graph
nor@graph_multi_asset
.As a beginner, I know I shouldn't be dabbling with graphs, and just use
@multi_asset
instead, however I'm tempted to use@graph_multi_asset
, as that allows me to see the sub-processes which the asset creation consists of.Attempt 1
This yeilds the following error:
The results from
my_landing_graph()
are already in a dictionary format, so the error puzzles me. As a mitigation I tried repacking the dictionary as follows:Attempt 2
This yeilds the following error (I have no idea why it adds a "_2" to the name):
I understand that both the
@graph
and@graph_multi_asset
functions are run during the build phase and not during execution. Therefore it somehow makes sense thatmy_landing_graph
returns aInvokedNodeOutputHandle
instead of the actual dictionary, howevermy_landing_graph_multi_asset
expects a dictionary, so I'm unsure what to do instead. I've tried reading the documentation, and have asked a few LLM's, but haven't found a solution. Any help is appreciated!Beta Was this translation helpful? Give feedback.
All reactions