Hello. I am trying to build an asset that returns ...
# ask-community
t
Hello. I am trying to build an asset that returns an
Output
object where
value: str
and
metadata: dict
for example:
Copy code
@asset
def my_asset() -> Output:
  # do stuff
  return Output(
    value="a_string",
    metadata={"meta": "data"}
  )
I am unsure of how to properly type check that
value
is a string and
metadata
is a dict in
Output
Any suggestions? Python and Dagster types are a bit new for me.
o
Hi Tim, you can use MetadataValue to control the output of metadata: https://docs.dagster.io/_apidocs/ops#dagster.MetadataValue
D 1
t
Thanks for the feedback!