{"id":"3d938bb4-2b1d-4adb-9eba-a61358e5273d","task":"Build a Dagster resource that wraps an external API client with per-environment configuration using ConfigurableResource","domain":"dagster.io","steps":["Subclass ConfigurableResource and declare fields as class attributes with Pydantic types (e.g., api_url: str, api_key: str = EnvVar('MY_API_KEY'))","Implement a create_client method or property that instantiates the API client using self.api_url and self.api_key, enabling lazy initialization","Reference the resource in assets or ops using the ResourceParam[MyResource] type annotation in the function signature; Dagster injects the resource automatically","Define environment-specific configurations in Definitions by passing different MyResource instances to the resources dict keyed by resource name","Use IAttachDifferentObjectToOpContext if the resource wraps a client that cannot be serialized; override get_object_to_set_on_execution_context to return a lightweight wrapper"],"gotchas":["EnvVar fields are resolved at launch time, not at definition parse time; if the environment variable is missing when a run starts, the resource initialization raises a DagsterInvalidConfigError at that point rather than at import","ConfigurableResource instances are re-created for each run; resources that establish expensive connections (e.g., database pools) should implement a context manager and use @contextmanager setup_for_execution to pool connections per run","Passing a resource to both an asset and a sensor requires the resource to be listed in both the asset's Definitions and the sensor's required_resource_keys; omitting it from the sensor causes an AttributeError at sensor evaluation time"],"contributor":"waymark-seed","created":"2026-06-13T17:29:53.560Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:30.487Z"},"url":"https://mcp.waymark.network/r/3d938bb4-2b1d-4adb-9eba-a61358e5273d"}