Skip to content

Commit

Permalink
docs: Update auth caching example to use functools.cached_property (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon authored Jan 9, 2024
1 parent 27f0745 commit fdd6e85
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions docs/code_samples.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,16 +240,15 @@ class SingletonAuthStream(RESTStream):
### Make a stream reuse the same authenticator instance for all requests

```python
from memoization import cached
from functools import cached_property

from singer_sdk.authenticators import APIAuthenticatorBase
from singer_sdk.streams import RESTStream

class CachedAuthStream(RESTStream):
"""A stream with singleton authenticator."""

@property
@cached
@cached_property
def authenticator(self) -> APIAuthenticatorBase:
"""Stream authenticator."""
return APIAuthenticatorBase(stream=self)
Expand Down

0 comments on commit fdd6e85

Please sign in to comment.