You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/09/07 08:42:30 UTC

[GitHub] [superset] audour opened a new issue #16613: "pybabel extract" gives "NameError: name 'SQLLAB_TIMEOUT' is not defined"

audour opened a new issue #16613:
URL: https://github.com/apache/superset/issues/16613


   Running `pybabel extract -F superset/translations/babel.cfg -o superset/translations/messages.pot -k _ -k __ -k t -k tn -k tct .` as suggested within [CONTRIBUTING.md#translating](https://github.com/apache/superset/blob/master/CONTRIBUTING.md#translating) is not working for me.
   
   ### Expected results
   
   The template file `superset/translations/messages.pot` is updated with current application strings.
   
   ### Actual results
   
   * I get an error `NameError: name 'SQLLAB_TIMEOUT' is not defined`.
   * `messages.pot` is emptied
   
   #### How to reproduce the bug
   
   Follow [CONTRIBUTING.md#extracting-new-strings-for-translation](https://github.com/apache/superset/blob/master/CONTRIBUTING.md#extracting-new-strings-for-translation)  
   
   ### Environment
   
   - superset version: `1.3.0`
   - python version: `3.8.10`
   - pybabel version: `2.9.1`
   
   ### Checklist
   
   - [ x ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   - [ x ] I have reproduced the issue with at least the latest released version of superset.
   - [ x ] I have checked the issue tracker for the same issue and I haven't found one similar.
   
   ### Additional context
   
   Full logs:
   
   ```
   $ pybabel extract -F superset/translations/babel.cfg -o superset/translations/messages.pot -k _ -k __ -k t -k tn -k tct .
   extracting messages from superset/__init__.py
   extracting messages from superset/app.py
   extracting messages from superset/cli.py
   extracting messages from superset/config.py
   extracting messages from superset/constants.py
   extracting messages from superset/dataframe.py
   extracting messages from superset/errors.py
   extracting messages from superset/exceptions.py
   extracting messages from superset/extensions.py
   extracting messages from superset/forms.py
   extracting messages from superset/jinja_context.py
   extracting messages from superset/legacy.py
   extracting messages from superset/result_set.py
   extracting messages from superset/schemas.py
   extracting messages from superset/sql_lab.py
   Traceback (most recent call last):
     File "/home/admin/superset_translation/venv/bin/pybabel", line 8, in <module>
       sys.exit(main())
     File "/home/admin/superset_translation/venv/lib/python3.8/site-packages/babel/messages/frontend.py", line 929, in main
       return CommandLineInterface().run(sys.argv)
     File "/home/admin/superset_translation/venv/lib/python3.8/site-packages/babel/messages/frontend.py", line 853, in run
       return cmdinst.run()
     File "/home/admin/superset_translation/venv/lib/python3.8/site-packages/babel/messages/frontend.py", line 481, in run
       for filename, lineno, message, comments, context in extracted:
     File "/home/admin/superset_translation/venv/lib/python3.8/site-packages/babel/messages/extract.py", line 149, in extract_from_dir
       for message_tuple in check_and_call_extract_file(
     File "/home/admin/superset_translation/venv/lib/python3.8/site-packages/babel/messages/extract.py", line 207, in check_and_call_extract_file
       for message_tuple in extract_from_file(
     File "/home/admin/superset_translation/venv/lib/python3.8/site-packages/babel/messages/extract.py", line 243, in extract_from_file
       return list(extract(method, fileobj, keywords, comment_tags,
     File "/home/admin/superset_translation/venv/lib/python3.8/site-packages/babel/messages/extract.py", line 325, in extract
       for lineno, funcname, messages, comments in results:
     File "/home/admin/superset_translation/venv/lib/python3.8/site-packages/babel/messages/extract.py", line 487, in extract_python
       value = eval(code, {'__builtins__': {}}, {})
     File "<string>", line 2, in <module>
   NameError: name 'SQLLAB_TIMEOUT' is not defined
   ```
   
   Linked issue: https://github.com/apache/superset/issues/16550


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro closed issue #16613: "pybabel extract" gives "NameError: name 'SQLLAB_TIMEOUT' is not defined"

Posted by GitBox <gi...@apache.org>.
villebro closed issue #16613:
URL: https://github.com/apache/superset/issues/16613


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] audour commented on issue #16613: "pybabel extract" gives "NameError: name 'SQLLAB_TIMEOUT' is not defined"

Posted by GitBox <gi...@apache.org>.
audour commented on issue #16613:
URL: https://github.com/apache/superset/issues/16613#issuecomment-915900550


   No, I haven't follow [CONTRIBUTING.md#setup-local-environment-for-development](https://github.com/apache/superset/blob/master/CONTRIBUTING.md#setup-local-environment-for-development) because it seemed useless for me as I just wanted to improve French translation. But ok I understand that it was documented.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] audour commented on issue #16613: "pybabel extract" gives "NameError: name 'SQLLAB_TIMEOUT' is not defined"

Posted by GitBox <gi...@apache.org>.
audour commented on issue #16613:
URL: https://github.com/apache/superset/issues/16613#issuecomment-915327738


   Thanks a lot @hushaoqing : I've applied locally your change and it works!
   
   Note:
   * I had a remaining issue because `pybabel extract -F superset/translations/babel.cfg -o superset/translations/messages.pot -k _ -k __ -k t -k tn -k tct .` crashed again logging `ValueError: Unknown extraction method 'jinja2'`. **It turns out that running `pip install jinja2` resolved the issue: maybe it should be documented at** https://github.com/apache/superset/blob/master/CONTRIBUTING.md#translating
   * I can create a dedicated issue if it seems relevant to you


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] audour edited a comment on issue #16613: "pybabel extract" gives "NameError: name 'SQLLAB_TIMEOUT' is not defined"

Posted by GitBox <gi...@apache.org>.
audour edited a comment on issue #16613:
URL: https://github.com/apache/superset/issues/16613#issuecomment-915900550


   No, I haven't followed [CONTRIBUTING.md#setup-local-environment-for-development](https://github.com/apache/superset/blob/master/CONTRIBUTING.md#setup-local-environment-for-development) because it seemed useless for me as I just wanted to improve French translation. But ok I understand that it was documented.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] audour edited a comment on issue #16613: "pybabel extract" gives "NameError: name 'SQLLAB_TIMEOUT' is not defined"

Posted by GitBox <gi...@apache.org>.
audour edited a comment on issue #16613:
URL: https://github.com/apache/superset/issues/16613#issuecomment-915327738


   Thanks a lot @hushaoqing : I've applied locally your change (https://github.com/apache/superset/pull/16629) and it works!
   
   Note:
   * I had a remaining issue because `pybabel extract -F superset/translations/babel.cfg -o superset/translations/messages.pot -k _ -k __ -k t -k tn -k tct .` crashed again logging `ValueError: Unknown extraction method 'jinja2'`. **It turns out that running `pip install jinja2` resolved the issue: maybe it should be documented at** https://github.com/apache/superset/blob/master/CONTRIBUTING.md#translating
   * I can create a dedicated issue if it seems relevant to you


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] hushaoqing commented on issue #16613: "pybabel extract" gives "NameError: name 'SQLLAB_TIMEOUT' is not defined"

Posted by GitBox <gi...@apache.org>.
hushaoqing commented on issue #16613:
URL: https://github.com/apache/superset/issues/16613#issuecomment-915706011


   @audour 
   `jinja2` has been included in the requirements.
   https://github.com/apache/superset/blob/c66f278b42e4de8f3aeb10066af259acb6eae041/requirements/base.txt#L129
   
   Have you tried to run `pip install -r requirements/testing.txt`?
   (documented at https://github.com/apache/superset/blob/master/CONTRIBUTING.md#flask-server)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org