From edba461b1a5409b1f1939b12a57ae3dfbddbc52d Mon Sep 17 00:00:00 2001 From: Alexandros Milaios Date: Thu, 22 Aug 2024 14:55:56 +0300 Subject: [PATCH] chore: use critical --- .../source_facebook_marketing/streams/base_insight_streams.py | 2 +- .../source_facebook_marketing/streams/base_streams.py | 4 ++-- .../source_facebook_marketing/streams/streams.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/streams/base_insight_streams.py b/airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/streams/base_insight_streams.py index d00f215ab5f9..0ec177ef180e 100644 --- a/airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/streams/base_insight_streams.py +++ b/airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/streams/base_insight_streams.py @@ -138,7 +138,7 @@ def read_records( expires_at = self._api.api.get_access_token_expiration() if expires_at and pendulum.from_timestamp(expires_at) - pendulum.now() < pendulum.duration(days=57): - self.logger.error(f"Access token expires at {pendulum.from_timestamp(expires_at)}. Please reconnect the source.") + self.logger.critical(f"Access token expires at {pendulum.from_timestamp(expires_at)}. Please reconnect the source.") @property def state(self) -> MutableMapping[str, Any]: diff --git a/airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/streams/base_streams.py b/airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/streams/base_streams.py index 2d0f8ead9f98..ba3a4ffcb209 100644 --- a/airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/streams/base_streams.py +++ b/airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/streams/base_streams.py @@ -123,7 +123,7 @@ def read_records( expires_at = self._api.api.get_access_token_expiration() if expires_at and pendulum.from_timestamp(expires_at) - pendulum.now() < pendulum.duration(days=7): - self.logger.error(f"Access token expires at {pendulum.from_timestamp(expires_at)}") + self.logger.critical(f"Access token expires at {pendulum.from_timestamp(expires_at)}") @abstractmethod def list_objects(self, params: Mapping[str, Any]) -> Iterable: @@ -288,4 +288,4 @@ def read_records( expires_at = self._api.api.get_access_token_expiration() if expires_at and pendulum.from_timestamp(expires_at) - pendulum.now() < pendulum.duration(days=7): - self.logger.error(f"Access token expires at {pendulum.from_timestamp(expires_at)}") + self.logger.critical(f"Access token expires at {pendulum.from_timestamp(expires_at)}") diff --git a/airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/streams/streams.py b/airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/streams/streams.py index f24fd17f2bd1..1428fc374f20 100644 --- a/airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/streams/streams.py +++ b/airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/streams/streams.py @@ -73,7 +73,7 @@ def read_records( expires_at = self._api.api.get_access_token_expiration() if expires_at and pendulum.from_timestamp(expires_at) - pendulum.now() < pendulum.duration(days=7): - self.logger.error(f"Access token expires at {pendulum.from_timestamp(expires_at)}") + self.logger.critical(f"Access token expires at {pendulum.from_timestamp(expires_at)}") def list_objects(self, params: Mapping[str, Any]) -> Iterable: return self._api.account.get_ad_creatives(params=params)