Hello, I upgraded to dagster 1.6.6 from 1.6.5 and ...
# dagster-plus
r
Hello, I upgraded to dagster 1.6.6 from 1.6.5 and a number of my unit tests started failing with the following error: > At least one provided resource is a generator, but attempting to access resources outside of context manager scope. You can use the following syntax to open a context manager:
with build_schedule_context(...) as context:
This appears to happen whenever I try testing a sensor but the documentation has not been updated. As an example, consider a sensor with the following signature:
Copy code
def create_solar_assets(ctx: SensorEvaluationContext, s3_rs: AssumedRole, dappcfg: DappConfig)
where
AssumedRole
and
DappConfig
are resources, which don't yield anything and therefore aren't generators. I get the error when, in the associated tests, I call:
Copy code
context = build_sensor_context(cursor="0")
requests = list(create_solar_assets(context, s3_rs=assumed_role(dapp_config, monkeypatch), dappcfg=dapp_config))
Seeing as this is a sensor, not a schedule, the error message doesn't really make sense. Honestly, this seems more like a bug than anything else. Please advise on how to address the issue.
As an aside, if this was intentional then it represents a breaking change and should not have been included as a patch release but at least a minor version change.
z
Might be good to file a Github Issue?
y
Hi Ryan, like Zach mentioned, could you please file a GH issue for this? We're monitoring cloud related issues in this channel. We're looking into it and can report updates on an issue
r
Ah, okay. I'll go ahead and do that.