When writing our own Resource that extends a `Conf...
# ask-community
m
When writing our own Resource that extends a
ConfigurableResource
, what’s the recommended approach for having a field that is required to store an intermediate value? E.g.:
Copy code
class MyResource(ConfigurableResource):
  user: str
  password: str
  _session_token: str

  def authenticate(self):
    # will get a session auth token from API.
    # Will use token to fetch some data from an API
    self._session_token = some_function()
In the above example an Exception will be thrown:
AttributeError: 'MyResource' object has no attribute '_session_token'
dagster bot responded by community 1
z
I think you want a PrivateAttr
ty thankyou 1
👌 1