Page MenuHomeElementl

Add a flag for whether resources object contains a generator
ClosedPublic

Authored by cdecarolis on May 6 2021, 6:14 PM.

Details

Summary

Add an additional flag class for whether resources object contains generator resource.

Test Plan

Unit tests, mypy

Diff Detail

Repository
R1 dagster
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.May 6 2021, 6:34 PM
Harbormaster failed remote builds in B30084: Diff 36960!
alangenfeld added inline comments.
python_modules/dagster/dagster/core/definitions/resource.py
262–263

add a comment to explain why its this way

265

clearer name minimum

python_modules/dagster/dagster/core/execution/resources_init.py
282–283

this kinda odd that we check gen before ensure gen but ??? maybe just a comment here

python_modules/dagster/dagster_tests/core_tests/resource_tests/test_build_resources.py
16

is this actually safe? add a test for an _is_generator resource key

This revision is now accepted and ready to land.May 7 2021, 2:55 PM

Change to use isinstance checks to determine generator-ness

I_Contains_Generator -> IContainsGenerator

cdecarolis retitled this revision from Make the constructed resources object not break mypy and add a flag for whether a resource is a generator to Add a flag for whether resources object contains a generator.May 12 2021, 2:31 PM
cdecarolis edited the summary of this revision. (Show Details)