-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
66 additions
and
47 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
lib/dl_connector_bundle_chs3/dl_connector_bundle_chs3/chs3_base/core/constants.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
from dl_constants.enums import NotificationType | ||
|
||
from dl_connector_clickhouse.core.clickhouse_base.constants import BACKEND_TYPE_CLICKHOUSE | ||
|
||
|
||
BACKEND_TYPE_CHS3 = BACKEND_TYPE_CLICKHOUSE | ||
|
||
NOTIF_TYPE_STALE_DATA = NotificationType.declare("stale_data") | ||
NOTIF_TYPE_DATA_UPDATE_FAILURE = NotificationType.declare("data_update_failure") |
32 changes: 32 additions & 0 deletions
32
lib/dl_connector_bundle_chs3/dl_connector_bundle_chs3/chs3_base/core/notifications.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from typing import Optional | ||
|
||
from dl_constants.enums import NotificationLevel | ||
from dl_core.reporting.notifications import BaseNotification | ||
|
||
from constants import NOTIF_TYPE_STALE_DATA, NOTIF_TYPE_DATA_UPDATE_FAILURE | ||
|
||
|
||
class StaleDataNotification(BaseNotification): | ||
type = NOTIF_TYPE_STALE_DATA | ||
_title = "Stale data" | ||
_message = "The data has not been updated for more than 30 minutes, a background update is in progress" | ||
_level = NotificationLevel.info | ||
|
||
|
||
class DataUpdateFailureNotification(BaseNotification): | ||
def __init__(self, err_code: str, request_id: Optional[str]) -> None: | ||
super().__init__() | ||
self.err_code = err_code | ||
self.request_id = request_id or "unknown" | ||
|
||
type = NOTIF_TYPE_DATA_UPDATE_FAILURE | ||
_title = "Data update failed" | ||
_message = ( | ||
"The displayed data may be outdated due to the failure of the last update.\n" | ||
"Reason: {err_code}, Request-ID: {request_id}." | ||
) | ||
_level = NotificationLevel.warning | ||
|
||
@property | ||
def message(self) -> str: | ||
return self._message.format(err_code=self.err_code, request_id=self.request_id) |
9 changes: 0 additions & 9 deletions
9
lib/dl_connector_bundle_chs3/dl_connector_bundle_chs3/chs3_gsheets/core/constants.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,8 @@ | ||
from dl_constants.enums import ( | ||
ConnectionType, | ||
DataSourceType, | ||
NotificationType, | ||
) | ||
|
||
from dl_connector_bundle_chs3.constants import ( | ||
NOTIF_TYPE_DATA_UPDATE_FAILURE, | ||
NOTIF_TYPE_STALE_DATA, | ||
) | ||
|
||
|
||
CONNECTION_TYPE_GSHEETS_V2 = ConnectionType.declare("gsheets_v2") | ||
SOURCE_TYPE_GSHEETS_V2 = DataSourceType.declare("GSHEETS_V2") | ||
|
||
NOTIF_TYPE_GSHEETS_V2_STALE_DATA = NOTIF_TYPE_STALE_DATA | ||
NOTIF_TYPE_GSHEETS_V2_DATA_UPDATE_FAILURE = NOTIF_TYPE_DATA_UPDATE_FAILURE |
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
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
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
8 changes: 2 additions & 6 deletions
8
lib/dl_connector_bundle_chs3/dl_connector_bundle_chs3/chs3_yadocs/core/constants.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
from dl_constants.enums import ( | ||
ConnectionType, | ||
DataSourceType, | ||
NotificationType, | ||
) | ||
from dl_connector_bundle_chs3.constants import NOTIF_TYPE_STALE_DATA, NOTIF_TYPE_DATA_UPDATE_FAILURE | ||
|
||
CONNECTION_TYPE_YADOCS = ConnectionType.declare("yadocs") | ||
SOURCE_TYPE_YADOCS = DataSourceType.declare("YADOCS") | ||
|
||
NOTIF_TYPE_YADOCS_STALE_DATA = NOTIF_TYPE_STALE_DATA | ||
NOTIF_TYPE_YADOCS_DATA_UPDATE_FAILURE = NOTIF_TYPE_DATA_UPDATE_FAILURE | ||
CONNECTION_TYPE_YADOCS = ConnectionType.declare("docs") | ||
SOURCE_TYPE_YADOCS = DataSourceType.declare("YADOCS") |
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
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
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
5 changes: 0 additions & 5 deletions
5
lib/dl_connector_bundle_chs3/dl_connector_bundle_chs3/constants.py
This file was deleted.
Oops, something went wrong.
Binary file modified
BIN
+56 Bytes
(120%)
...r_bundle_chs3/dl_connector_bundle_chs3/locales/en/LC_MESSAGES/dl_connector_bundle_chs3.mo
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,15 +4,15 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: [email protected]\n" | ||
"POT-Creation-Date: 2023-09-22 08:14+0000\n" | ||
"POT-Creation-Date: 2023-11-09 14:12+0000\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
|
||
msgid "label_connector-gsheets_v2" | ||
msgstr "Google Sheets" | ||
|
||
msgid "label_connector-gsheets_v2" | ||
msgid "label_connector-yadocs" | ||
msgstr "Yandex Documents" | ||
|
||
msgid "label_connector-file" | ||
|
Binary file modified
BIN
+71 Bytes
(120%)
...r_bundle_chs3/dl_connector_bundle_chs3/locales/ru/LC_MESSAGES/dl_connector_bundle_chs3.mo
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: [email protected]\n" | ||
"POT-Creation-Date: 2023-09-22 08:14+0000\n" | ||
"POT-Creation-Date: 2023-11-09 14:12+0000\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
|
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
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