Skip to content

Instantly share code, notes, and snippets.

@patrikbraborec
Last active February 17, 2023 09:39
Show Gist options
  • Save patrikbraborec/e6d1bbbdeefc9ba442d74505ffd37cfb to your computer and use it in GitHub Desktop.
Save patrikbraborec/e6d1bbbdeefc9ba442d74505ffd37cfb to your computer and use it in GitHub Desktop.
from logging import Logger
from gooddata_sdk import GoodDataSdk
from analytics.credentials import GoodDataCredentials
class GoodDataAnalytics:
def __init__(self, logger: Logger, credentials: GoodDataCredentials):
self.logger = logger
self.host = credentials.host
self.token = credentials.token
self.data_source_id = credentials.data_source_id
self.sdk = GoodDataSdk.create(self.host, self.token)
def invalid_cache(self) -> None:
try:
self.sdk.catalog_data_source.register_upload_notification(
self.data_source_id
)
self.logger.info("Cache has been invalided")
except RuntimeError:
self.logger.error("Cache has not been invalided")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment