https://dagster.io/ logo
#dagster-support
Title
# dagster-support
b

Ben Gatewood

08/08/2022, 11:56 AM
What I mean particularly, is that some of the alternatives don't seem to link up: These assets are partitioned on a static list of values and, as best I can tell from the docs, the only way to set up a partitioned asset is via the
partitions_def
argument to the
@asset
decorator. If I want to add metadata to a materialisation, the docs only mention how to do it via an
op
based asset or from a custom IO manager. So I could make them an
op
in a graph-backed asset maybe? But I can't see any docs on how to partition graph-backed assets? (I know you can actually because I went digging in the source for
AssetsDefinition.from_graph()
but it's not at all clear from the docs)
s

Stephen Bailey

08/08/2022, 1:48 PM
I know that one way you can log metadata is via the
context.add_output_metadata
method, which will log whatever is in the dict to the AssetMaterialization event that running the asset produces. I'm not sure how this plays with partitions yet.
Copy code
@asset
def my_asset(context):
    context.add_output_metadata({"how_cool": "so_cool"})
    return [1, 2, 3]
Also, my understanding is that all assets are "op-backed" assets. Under the hood, @asset is basically an @op with superpowers
🌈 1
c

claire

08/08/2022, 6:50 PM
Hi Ben! In addition to what Stephen mentioned, you can also add metadata to an asset materialization by doing something like this:
Copy code
yield Output(5, metadata={"my_metadata": 5})
I can file a ticket to document partitioning graph-backed assets
@Dagster Bot docs no documentation for partitioned graph-backed assets
d

Dagster Bot

08/08/2022, 6:51 PM
c

claire

08/08/2022, 6:59 PM
@Dagster Bot docs missing documentation for attaching metadata to asset materialization
d

Dagster Bot

08/08/2022, 6:59 PM
b

Ben Gatewood

08/08/2022, 10:33 PM
Thanks Stephen and Claire! To be clear, I don't think any actual functionality is missing here but I found myself chasing my tail a bit through the docs on this one
c

claire

08/08/2022, 10:38 PM
Definitely--thanks Ben for reporting these gaps. Docs improvements are important to us and we definitely want to improve our coverage. Please feel free to report future questions / docs issues!
b

Ben Gatewood

08/08/2022, 10:52 PM
Yup will do. Overall, I think they're already really good btw. I don't normally have to spend very much time in there to find what I need
🌈 1