Skip to content
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

output_materialization_config should be able to yield arbitrarily many Materializations #1848

Closed
mgasner opened this issue Oct 17, 2019 · 1 comment
Assignees

Comments

@mgasner
Copy link
Contributor

mgasner commented Oct 17, 2019

No description provided.

@mgasner mgasner added the core label Oct 17, 2019
yuhan added a commit that referenced this issue Mar 19, 2020
…ly many Materializations

Summary:
Issue: #1848
Enabled `@output_materialization_config` to yield multiple Materializations
- Addition to returning a Materialization, `output_materialization_config` can also yield multiple Materializations (a generator of Materializations.
  * To treat return and yield the same way in the core, we are going to check [[ https://github.com/dagster-io/dagster/blob/9b2ff392c994de6849c701068d31f0a8756b36ad/python_modules/dagster/dagster/utils/__init__.py#L270 | ensure_gen ]] in `OutputSchemaForDecorator.materialize_runtime_values` every time this gets called.
- Changed `intro_tutorial/output_materialization.py` to yield two Materializations (use case is to output both csv and json)

Test Plan:
- unit
- ran output_materialization in tutorial through CLI and dagit
- BK

Reviewers: max, prha

Reviewed By: prha

Subscribers: alangenfeld

Differential Revision: https://dagster.phacility.com/D2263
@yuhan
Copy link
Contributor

yuhan commented Mar 19, 2020

example:

yield Materialization(
'data_frame_json',
'LessSimpleDataFrame materialized as json',
[
EventMetadataEntry.path(
path=json_path,
label='data_frame_json_path',
description='LessSimpleDataFrame written to json format',
)
],
)

@yuhan yuhan closed this as completed Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants