-
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.
Implemented function extensions for formula ref and connectorized som…
…e note blocks (#70)
- Loading branch information
Showing
36 changed files
with
348 additions
and
170 deletions.
There are no files selected for viewing
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
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:15+0000\n" | ||
"POT-Creation-Date: 2023-09-22 08:16+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
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:15+0000\n" | ||
"POT-Creation-Date: 2023-09-22 08:16+0000\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
|
@@ -14,3 +14,25 @@ msgstr "" | |
|
||
msgid "`ClickHouse` version `22.10`" | ||
msgstr "" | ||
|
||
msgid "" | ||
"The function with three arguments is only available for the sources " | ||
"{dialects:CLICKHOUSE_21_8} or higher." | ||
msgstr "" | ||
|
||
msgid "" | ||
"For {dialects:CLICKHOUSE} data sources, numeric {arg:0} values less than or " | ||
"equal to `65535` are interpreted as the number of days (not seconds, like in " | ||
"all other cases) since January 1st 1970. This is the result of the behavior " | ||
"of available {dialects:CLICKHOUSE} functions.\n" | ||
"\n" | ||
"One way to surpass this is to use the following formula: " | ||
"`DATE(DATETIME([value]))`. The result is more consistent, but is likely to " | ||
"be much slower." | ||
msgstr "" | ||
|
||
msgid "" | ||
"Due to implementation details of the {type:FLOAT} type in {dialects:" | ||
"CLICKHOUSE} sources it is recommended to use the {ref:COMPARE} function " | ||
"instead of comparison operators for this type." | ||
msgstr "" |
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:15+0000\n" | ||
"POT-Creation-Date: 2023-09-22 08:16+0000\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
|
Binary file modified
BIN
+1.84 KB
(560%)
.../dl_connector_clickhouse/locales/ru/LC_MESSAGES/dl_formula_ref_dl_connector_clickhouse.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:15+0000\n" | ||
"POT-Creation-Date: 2023-09-22 08:16+0000\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
|
@@ -14,3 +14,38 @@ msgstr "`ClickHouse` версии `21.8`" | |
|
||
msgid "`ClickHouse` version `22.10`" | ||
msgstr "`ClickHouse` версии `22.10`" | ||
|
||
msgid "" | ||
"The function with three arguments is only available for the sources " | ||
"{dialects:CLICKHOUSE_21_8} or higher." | ||
msgstr "" | ||
"Функция с тремя аргументами доступна только для источников {dialects:" | ||
"CLICKHOUSE_21_8} и выше." | ||
|
||
msgid "" | ||
"For {dialects:CLICKHOUSE} data sources, numeric {arg:0} values less than or " | ||
"equal to `65535` are interpreted as the number of days (not seconds, like in " | ||
"all other cases) since January 1st 1970. This is the result of the behavior " | ||
"of available {dialects:CLICKHOUSE} functions.\n" | ||
"\n" | ||
"One way to surpass this is to use the following formula: " | ||
"`DATE(DATETIME([value]))`. The result is more consistent, but is likely to " | ||
"be much slower." | ||
msgstr "" | ||
"Источники {dialects:CLICKHOUSE} воспринимают числовые значения {arg:0} " | ||
"меньше или равные `65535` как количество дней (не секунд, как во всех " | ||
"остальных случаях) с 1 января 1970 г. Это следствие поведения доступных в " | ||
"{dialects:CLICKHOUSE} функций.\n" | ||
"\n" | ||
"Чтобы обойти это, воспользуйтесь формулой: `DATE(DATETIME([value]))`. " | ||
"Формула имеет более корректное поведение, но может работать значительно " | ||
"медленнее." | ||
|
||
msgid "" | ||
"Due to implementation details of the {type:FLOAT} type in {dialects:" | ||
"CLICKHOUSE} sources it is recommended to use the {ref:COMPARE} function " | ||
"instead of comparison operators for this type." | ||
msgstr "" | ||
"Из-за особенностей реализации типа {type:FLOAT} в источниках {dialects:" | ||
"CLICKHOUSE} рекомендуется для этого типа использовать функцию {ref:COMPARE} " | ||
"вместо операторов сравнения." |
3 changes: 1 addition & 2 deletions
3
lib/dl_connector_clickhouse/dl_connector_clickhouse_tests/db/api/base.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
23 changes: 23 additions & 0 deletions
23
lib/dl_connector_metrica/dl_connector_metrica/formula_ref/i18n.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,23 @@ | ||
import os | ||
|
||
import attr | ||
|
||
from dl_i18n.localizer_base import Translatable as BaseTranslatable | ||
from dl_i18n.localizer_base import TranslationConfig | ||
|
||
import dl_connector_metrica as package | ||
|
||
|
||
DOMAIN = f"dl_formula_ref_{package.__name__}" | ||
|
||
_LOCALE_DIR = os.path.join(os.path.dirname(__file__), "..", "locales") | ||
|
||
CONFIGS = [ | ||
TranslationConfig(path=_LOCALE_DIR, domain=DOMAIN, locale="en"), | ||
TranslationConfig(path=_LOCALE_DIR, domain=DOMAIN, locale="ru"), | ||
] | ||
|
||
|
||
@attr.s | ||
class Translatable(BaseTranslatable): | ||
domain: str = attr.ib(default=DOMAIN) |
21 changes: 21 additions & 0 deletions
21
lib/dl_connector_metrica/dl_connector_metrica/formula_ref/plugin.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,9 +1,30 @@ | ||
from dl_formula_ref.functions.operator import FUNCTION_OP_PLUS | ||
from dl_formula_ref.plugins.base.plugin import FormulaRefPlugin | ||
from dl_formula_ref.registry.note import ( | ||
Note, | ||
NoteLevel, | ||
) | ||
|
||
from dl_connector_metrica.formula.constants import MetricaDialect | ||
from dl_connector_metrica.formula_ref.human_dialects import HUMAN_DIALECTS | ||
from dl_connector_metrica.formula_ref.i18n import ( | ||
CONFIGS, | ||
Translatable, | ||
) | ||
|
||
|
||
class MetricaFormulaRefPlugin(FormulaRefPlugin): | ||
any_dialects = frozenset((*MetricaDialect.METRIKAAPI.to_list(),)) | ||
human_dialects = HUMAN_DIALECTS | ||
translation_configs = frozenset(CONFIGS) | ||
function_extensions = [ | ||
FUNCTION_OP_PLUS.extend( | ||
dialect=MetricaDialect.METRIKAAPI, | ||
notes=[ | ||
Note( | ||
level=NoteLevel.warning, | ||
text=Translatable("{dialects: METRIKAAPI} does not support string concatenation."), | ||
) | ||
], | ||
), | ||
] |
Binary file added
BIN
+241 Bytes
...etrica/dl_connector_metrica/locales/en/LC_MESSAGES/dl_formula_ref_dl_connector_metrica.mo
Binary file not shown.
13 changes: 13 additions & 0 deletions
13
...etrica/dl_connector_metrica/locales/en/LC_MESSAGES/dl_formula_ref_dl_connector_metrica.po
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,13 @@ | ||
# Copyright (c) 2023 YANDEX LLC <[email protected]> | ||
# This file is distributed under the same license as the DataLens package. | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: [email protected]\n" | ||
"POT-Creation-Date: 2023-11-06 10:45+0000\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
|
||
msgid "{dialects: METRIKAAPI} does not support string concatenation." | ||
msgstr "" |
Binary file added
BIN
+417 Bytes
...etrica/dl_connector_metrica/locales/ru/LC_MESSAGES/dl_formula_ref_dl_connector_metrica.mo
Binary file not shown.
13 changes: 13 additions & 0 deletions
13
...etrica/dl_connector_metrica/locales/ru/LC_MESSAGES/dl_formula_ref_dl_connector_metrica.po
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,13 @@ | ||
# Copyright (c) 2023 YANDEX LLC <[email protected]> | ||
# This file is distributed under the same license as the DataLens package. | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: [email protected]\n" | ||
"POT-Creation-Date: 2023-11-06 10:45+0000\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
|
||
msgid "{dialects: METRIKAAPI} does not support string concatenation." | ||
msgstr "{dialects: METRIKAAPI} не поддерживает конкатенацию строк." |
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
Binary file modified
BIN
+470 Bytes
(170%)
.../dl_connector_postgresql/locales/ru/LC_MESSAGES/dl_formula_ref_dl_connector_postgresql.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
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
Oops, something went wrong.