-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support direct invocation with AssetExecutionContext #16635
support direct invocation with AssetExecutionContext #16635
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
d596c86
to
9c78c7e
Compare
python_modules/dagster/dagster/_core/execution/context/invocation.py
Outdated
Show resolved
Hide resolved
if isinstance(args[0], UnboundAssetExecutionContext): | ||
context = cast(UnboundAssetExecutionContext, args[0]) | ||
else: | ||
context = cast(UnboundOpExecutionContext, args[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't even worth doing all the casting at this point? Seems like the typechecker will be totally confused as to what type "context" is anyways.
From brief inspection it appears the only requirement of the context
local variable is that it have a bind
method, so it you really want that typed you can introduce an interface that has this, but this looks like mostly pointless, unnecessary gymnastics to appease typechecking gods, unless I am misreading this
5e7ed31
to
dfd922e
Compare
9c78c7e
to
7c6b42a
Compare
dfd922e
to
689e3f1
Compare
7c6b42a
to
431ffab
Compare
689e3f1
to
83a075e
Compare
431ffab
to
663d09f
Compare
83a075e
to
ac9cb0b
Compare
663d09f
to
6183193
Compare
ac9cb0b
to
53a3b9a
Compare
6183193
to
ad48103
Compare
53a3b9a
to
32d5c77
Compare
ad48103
to
cd94444
Compare
32d5c77
to
5a064ff
Compare
7042434
to
b29961c
Compare
384d390
to
5c4494f
Compare
b29961c
to
5257cc4
Compare
5c4494f
to
2c59e3b
Compare
5257cc4
to
a53d70c
Compare
2c59e3b
to
ab3472a
Compare
) | ||
|
||
|
||
class UnboundOpExecutionContext(OpExecutionContext): | ||
class BoundExecutionContext(OpExecutionContext): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having this interface be a child of OpExecutionContext
feels shady, but it's the only way i was able to find to make the type checker happy.
When AssetExecutionContext eventually splits from OpExecutionContext there will be a good amount of work to do to make the path through op_invocation.py
happy with the two types
a53d70c
to
5ca0129
Compare
ab3472a
to
2b23f4f
Compare
5ca0129
to
3b8faaa
Compare
2b23f4f
to
db73b3c
Compare
converting to draft to get out of review queues. will need to re-open or open a similar PR when method deprecations for Asset context start |
#18044 replaces this |
Summary & Motivation
updates
build_asset_context
so that it creates a subclass ofAssetExecutionContext
I'm not very familiar with this part of the code base. My general approach was to follow where
UnboudOpExecutionContext
andBoundOpExecutionContext
are used and update them to also supportUnbound
andBoundAssetExecutionContext
.How I Tested These Changes