https://dagster.io/ logo
#dagster-plus
Title
# dagster-plus
r

Ryan Wood

02/27/2024, 2:38 AM
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

Zach

02/27/2024, 6:07 PM
Might be good to file a Github Issue?
y

yuhan

02/27/2024, 6:59 PM
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

Ryan Wood

02/28/2024, 5:04 AM
Ah, okay. I'll go ahead and do that.
3 Views