Last active
February 17, 2023 09:39
-
-
Save patrikbraborec/e6d1bbbdeefc9ba442d74505ffd37cfb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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