From b3c38ebe67ea15b2f359f53ef7c434ebd2a7e333 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= Date: Mon, 8 Jan 2024 19:55:58 -0600 Subject: [PATCH] docs: Update auth caching example to use `functools.cached_property` --- docs/code_samples.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/code_samples.md b/docs/code_samples.md index 0cd79f563..6d9efefd1 100644 --- a/docs/code_samples.md +++ b/docs/code_samples.md @@ -240,7 +240,7 @@ 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 @@ -248,8 +248,7 @@ 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)