Skip to content

Commit

Permalink
Moved a PG note to PG connector from formula ref
Browse files Browse the repository at this point in the history
  • Loading branch information
altvod committed Nov 9, 2023
1 parent c0c3b04 commit 10a80fd
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 24 deletions.
2 changes: 2 additions & 0 deletions docker_build/target_translations/target_update_po/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ RUN for domain_pair in $(dl-package --package-path=. list-i18n-domains) ; do \
for locale in $(ls $PACKAGE_NAME/locales/) ; do \
mkdir -p $LOCALES_DIR/$locale/LC_MESSAGES ; \
msgmerge $PACKAGE_NAME/locales/$locale/LC_MESSAGES/$DOMAIN_NAME.po $DOMAIN_NAME.po > $LOCALES_DIR/$locale/LC_MESSAGES/$DOMAIN_NAME.po; \
# Now replace the date with a fixed one so that it doesn't get updated every time
sed -i -r "s/POT-Creation-Date: [0-9]+-[0-9]+-[0-9]+ [0-9]+:[0-9]+\\+[0-9]+/POT-Creation-Date: 2023-09-22 08:16+0000/g" $LOCALES_DIR/$locale/LC_MESSAGES/$DOMAIN_NAME.po; \
done; \
done

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
CONFIGS,
Translatable,
)
from dl_formula_ref.functions.array import FUNCTION_UNNEST
from dl_formula_ref.registry.note import Note


class PostgresSQLFormulaRefPlugin(FormulaRefPlugin):
Expand All @@ -28,3 +30,17 @@ class PostgresSQLFormulaRefPlugin(FormulaRefPlugin):
(PostgreSQLDialect.NON_COMPENG_POSTGRESQL, "varchar"): Translatable("Alias for `character varying`"),
},
)
function_extensions = [
FUNCTION_UNNEST.extend(
dialect=PostgreSQLDialect.NON_COMPENG_POSTGRESQL,
notes=(
Note(
Translatable(
"{dialects: POSTGRESQL} doesn't allow filtering fields containing the UNNEST "
"function. If the data source is {dialects: POSTGRESQL}, do not use such "
"fields in selectors."
)
),
),
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ msgstr ""

msgid "Alias for `character varying`"
msgstr ""

msgid ""
"{dialects: POSTGRESQL} doesn't allow filtering fields containing the UNNEST "
"function. If the data source is {dialects: POSTGRESQL}, do not use such "
"fields in selectors."
msgstr ""
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,12 @@ msgstr "Алиас для `character`"

msgid "Alias for `character varying`"
msgstr "Алиас для `character varying`"

msgid ""
"{dialects: POSTGRESQL} doesn't allow filtering fields containing the UNNEST "
"function. If the data source is {dialects: POSTGRESQL}, do not use such "
"fields in selectors."
msgstr ""
"{dialects: POSTGRESQL} запрещает фильтрацию по полям, содержащим функцию "
"`UNNEST`. Не используйте такие поля для создания селектора, если источник "
"данных — {dialects: POSTGRESQL}."
9 changes: 0 additions & 9 deletions lib/dl_formula_ref/dl_formula_ref/functions/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,6 @@
name="unnest",
category=CATEGORY_ARRAY,
description=_("Expands the {arg:0} array expression to a set of rows."),
notes=[
Note(
Translatable(
"{dialects: POSTGRESQL} doesn't allow filtering fields containing the UNNEST "
"function. If the data source is {dialects: POSTGRESQL}, do not use such "
"fields in selectors."
)
),
],
examples=[
DataExample(
example_config=ExampleConfig(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -777,12 +777,6 @@ msgstr ""
msgid "Expands the {arg:0} array expression to a set of rows."
msgstr ""

msgid ""
"{dialects: POSTGRESQL} doesn't allow filtering fields containing the UNNEST "
"function. If the data source is {dialects: POSTGRESQL}, do not use such "
"fields in selectors."
msgstr ""

msgid ""
"Returns the element with the index {arg:1} from the array {arg:0}. Index "
"must be any integer. Indexes in an array begin with one."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1202,15 +1202,6 @@ msgstr ""
msgid "Expands the {arg:0} array expression to a set of rows."
msgstr "Дублирует исходную строку для каждого элемента массива {arg:0}."

msgid ""
"{dialects: POSTGRESQL} doesn't allow filtering fields containing the UNNEST "
"function. If the data source is {dialects: POSTGRESQL}, do not use such "
"fields in selectors."
msgstr ""
"{dialects: POSTGRESQL} запрещает фильтрацию по полям, содержащим функцию "
"`UNNEST`. Не используйте такие поля для создания селектора, если источник "
"данных — {dialects: POSTGRESQL}."

msgid ""
"Returns the element with the index {arg:1} from the array {arg:0}. Index "
"must be any integer. Indexes in an array begin with one."
Expand Down

0 comments on commit 10a80fd

Please sign in to comment.