Is this <documentation for graphs> still supported...
# ask-community
s
Is this documentation for graphs still supported? I'm trying to use
to_source_asset()
to satisfy an
op
input but loading the
Definitions
throws:
Copy code
FAILED tests/test_graph_with_source_asset.py::test_dependency - dagster._core.errors.DagsterInvalidDefinitionError: Input 'emails' of op 'send_emails_with_footer' has no way of being resolved. Must provide a resolution to this input via another op/graph, or via a d...
Here's a simple repro: https://gist.github.com/sbquinlan/001006e9a601a838e55870e394b14e7e
c
Hi Sean. I refactored your example a bit, to instead pass the upstream asset as an input to the graph-asset:
Copy code
@asset
def pending_email():
    ...


@op
def mailing_list() -> str:
    return "<mailto:foo@bar.com|foo@bar.com>"


@op
def send_emails_with_footer(
    to: str,
    emails,
) -> str:
    ...


@graph_asset
def send_emails_graph(pending_email) -> str:
    return send_emails_with_footer(to=mailing_list(), emails=pending_email)
and it looks like it's executing properly now. My guess is that the behavior you observed is probably an oddity related to an upstream asset not being passed as an input to the graph asset
That documentation should be supported though--my guess it is works for jobs, but not `graph_asset`s
s
Thanks @claire, strangely the
@graph_asset
works if you don't use
Definitions
and just call
send_emails_graph.<http://node_def.to|node_def.to>_job()
the
AssetLayer
is constructed completely differently in the
GraphDefinition
instead of the
Definitions
call