Skip to content

Commit

Permalink
refactor: Use functools.lru_cache instead of the stale `memoization…
Browse files Browse the repository at this point in the history
…` library (#1981)
  • Loading branch information
edgarrmondragon committed Oct 11, 2023
1 parent eec8bd3 commit 3bb4f2f
Show file tree
Hide file tree
Showing 6 changed files with 533 additions and 657 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
Loading

0 comments on commit 3bb4f2f

Please sign in to comment.