Hello! We are migrating to the Pythonic resources ...
# ask-community
l
Hello! We are migrating to the Pythonic resources on our project and I encountered an issue. We basically used to have a “*configurable third-party API client*”. But now I can’t figure out how I should do this. There are either
ConfigurableResources
, or
ResourceParam
, but it seems none of them offers the flexibility we had before to get a fully functional SDK configured in a resource. Former code:
Copy code
from dagster import resource, Field
from my_sdk import SDKClient

@resource(config_schema={"some-conf": Field(str)}
def my_sdk(context: InitResourceContext) -> SDKClient:
    return SDKClient(context.resource_config["some-conf"])

@op(required_resource_keys={'my_sdk'})
def my_op(context):
    my_sdk: SDKClient = context.resources.my_sdk
    my_sdk.my_func()
Thanks by advance and have a nice day! Louis