-
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
[for 1.6] Skip I/O manager when return type is Nothing #17451
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
Some notes from standup today:
Some related thoughts:
|
def test_asset_none_output_non_none_input():
@asset
def asset1() -> None:
return None
@asset
def asset2(asset1):
assert asset1 is None
assert materialize_to_memory([asset1, asset2]).success How difficult would it be to get this to work? Couldn't we just unconditionally always pass None for upstream assets that are typed as |
yeah that's definitely one solution. I think the only kind of weird case is if you had However, if you had the same setup with |
b024c34
to
a6ed735
Compare
Deploy preview for dagit-storybook ready! ✅ Preview Built with commit a6ed735. |
Deploy preview for dagit-core-storybook ready! ✅ Preview Built with commit a6ed735. |
a6ed735
to
387fa7d
Compare
bumping this back up for review I looked into how to provide |
python_modules/dagster/dagster/_core/execution/plan/execute_step.py
Outdated
Show resolved
Hide resolved
python_modules/dagster/dagster/_core/execution/plan/execute_step.py
Outdated
Show resolved
Hide resolved
python_modules/dagster/dagster/_core/execution/plan/execute_step.py
Outdated
Show resolved
Hide resolved
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.
expecting changes from last set of comments
turning this back into a draft for now to get it out of review queues. I'm exploring another way to do this here but it's running into similar catch-22 issues as this PR. |
f26441e
to
1894db5
Compare
popping this back into review queues. See the updated description for the current state of the PR and an issue the dbt and airbyte integrations present that we'll need to resolve. I'm going to spend some time today thinking about potential solutions, but if you have ideas that would be great |
73f5052
to
4ca76b7
Compare
python_modules/dagster/dagster/_core/execution/plan/execute_step.py
Outdated
Show resolved
Hide resolved
dc1b570
to
67c970e
Compare
a9f7ba4
to
c0c2eda
Compare
Summary & Motivation
Currently, pipelines we are describing as non-I/O manager pipelines still invoke the I/O manager
handle_output
method. This RFC proposes fully skipping the I/O manager when thedagster_type
of theOutput
isNothing
. This means that assets with the return type annotationNone
andMaterializeResult
(bc it gets coerced to Nothing) will not invoke the I/O manager.Assets that return
MaterializeResult
but do not have a return type annotation will log a warning, but still invoke the I/O Manager.If a user tries to load an asset with
Nothing
return type annotation in a downstream asset, the I/O manager will still be invoked. The reasoning:Nothing
outputs. This means that users who are using these I/O managers already have code that is compatible with the changes in this PRNothing
outputs are the in memory I/O manager and the dagstermill I/O manager. The in memory I/O manager is mainly useful for unit tests, which means that in production, the code would need to be using another I/O manager (likely one that doesn't storeNothing
outputs)For users who have written code that relies on storing and loading
None
values in order to set up dependencies with their assets/ops, they can switch to usingdeps
for assets, and Nothing dependencies for ops.How I Tested These Changes