plf03/16/2023, 12:09 AM
raises this error:
@asset def some_asset(): output = "some_great_output" return Output( value=output, output_name=some_name, )
how do i fix this?
dagster._core.errors.DagsterInvariantViolationError: Bad state: Output was explicitly named 'some_name', which does not match the output definition specified for position 0: 'result'.
yuhan03/16/2023, 3:17 AM
you don’t need to specify the name
@asset def some_asset(): output = "some_great_output" return Output( value=output, )
@asset def some_asset(): output = "some_great_output" return output
would yield only one output, which is considered as “the data asset” tied to this computation. if you’d like to yield multiple outputs in one asset, you can use
https://docs.dagster.io/concepts/assets/multi-assets where you can give names to different outputs
plf03/16/2023, 10:11 AM
object even for a (non-multi) asset, e.g. to attach metadata to it (correct me if that’s wrong). but if you wrap your output into an
object, the asset gets the default name “result” - not exactly a very useful name for an asset. hence my need to give it an explicit name. that should be possible somehow, right?
decorator does not expect an
parameter or an
parameter or anything like that, how do you specify an
yuhan03/16/2023, 6:21 PM
too. here’s an example: https://github.com/dagster-io/dagster/blob/master/examples/quickstart_etl/quickstart_etl/assets/hackernews.py#L40-L49 as for “result” isn’t useful name, when you’re using the single asset with single output (1:1 mapping), the name “result” becomes an implementation detail because the output metadata will show up in that asset page, which is why
doesn’t have the
argument bc it doesn’t need to. that being said, if you do need to
, you can