This is an automated email from the ASF dual-hosted git repository.

dpgaspar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new ea9b7f2  fix(babel): broken babel extract (#9790)
ea9b7f2 is described below

commit ea9b7f2dc426cf912f8f5f2b749cc707c9af6964
Author: Daniel Vaz Gaspar <[email protected]>
AuthorDate: Fri May 15 19:05:24 2020 +0100

    fix(babel): broken babel extract (#9790)
    
    * fix(babel): broken babel extract
    
    * remove unnecessary f strings
---
 .github/workflows/superset-python.yml    | 21 +++++++++++++++++++++
 superset/datasets/commands/exceptions.py |  5 +++--
 superset/views/core.py                   | 12 +++++++-----
 3 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/superset-python.yml 
b/.github/workflows/superset-python.yml
index ac4b20d..d3f61b1 100644
--- a/.github/workflows/superset-python.yml
+++ b/.github/workflows/superset-python.yml
@@ -50,6 +50,27 @@ jobs:
     - name: Build documentation
       run: sphinx-build -b html docs _build/html -W
 
+  babel-extract:
+    runs-on: ubuntu-18.04
+    strategy:
+      matrix:
+        python-version: [3.6]
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v2
+      - name: Setup Python
+        uses: actions/setup-python@v1
+        with:
+          python-version: ${{ matrix.python-version }}
+      - name: Install dependencies
+        uses: apache-superset/cached-dependencies@adc6f73
+        with:
+          run: |
+            pip-install
+            pip install -r docs/requirements.txt
+      - name: Test babel extraction
+        run: flask fab babel-extract --target superset/translations --output 
superset/translations/messages.pot --config superset/translations/babel.cfg -k 
_,__,t,tn,tct
+
   test-postgres:
     runs-on: ubuntu-18.04
     strategy:
diff --git a/superset/datasets/commands/exceptions.py 
b/superset/datasets/commands/exceptions.py
index e5f3ae2..69bd7cd 100644
--- a/superset/datasets/commands/exceptions.py
+++ b/superset/datasets/commands/exceptions.py
@@ -127,10 +127,11 @@ class TableNotFoundValidationError(ValidationError):
     def __init__(self, table_name: str) -> None:
         super().__init__(
             _(
-                f"Table [{table_name}] could not be found, "
+                "Table [%(table_name)s] could not be found, "
                 "please double check your "
                 "database connection, schema, and "
-                f"table name"
+                "table name",
+                table_name=table_name,
             ),
             field_names=["table_name"],
         )
diff --git a/superset/views/core.py b/superset/views/core.py
index e688d42..9952223 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -1701,9 +1701,9 @@ class Superset(BaseSupersetView):
             if not table:
                 return json_error_response(
                     __(
-                        "Table %(t)s wasn't found in the database %(d)s",
-                        t=table_name,
-                        s=db_name,
+                        "Table %(table)s wasn't found in the database %(db)s",
+                        table=table_name,
+                        db=db_name,
                     ),
                     status=404,
                 )
@@ -2308,9 +2308,11 @@ class Superset(BaseSupersetView):
         except Exception as ex:
             logger.exception(ex)
             msg = _(
-                f"{validator.name} was unable to check your query.\n"
+                "%(validator)s was unable to check your query.\n"
                 "Please recheck your query.\n"
-                f"Exception: {ex}"
+                "Exception: %(ex)s",
+                validator=validator.name,
+                ex=ex,
             )
             # Return as a 400 if the database error message says we got a 4xx 
error
             if re.search(r"([\W]|^)4\d{2}([\W]|$)", str(ex)):

Reply via email to