[
https://issues.apache.org/jira/browse/AIRFLOW-2407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16622610#comment-16622610
]
ASF GitHub Bot commented on AIRFLOW-2407:
-----------------------------------------
Fokko closed pull request #3298: [AIRFLOW-2407] Use feature detection for
reload()
URL: https://github.com/apache/incubator-airflow/pull/3298
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/airflow/www/app.py b/airflow/www/app.py
index ca0589d669..e9b2c35db3 100644
--- a/airflow/www/app.py
+++ b/airflow/www/app.py
@@ -144,11 +144,7 @@ def integrate_plugins():
# required for testing purposes otherwise the module retains
# a link to the default_auth
if app.config['TESTING']:
- if six.PY2:
- reload(e)
- else:
- import importlib
- importlib.reload(e)
+ six.moves.reload_module(e)
app.register_blueprint(e.api_experimental,
url_prefix='/api/experimental')
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Undefined names in Python code
> ------------------------------
>
> Key: AIRFLOW-2407
> URL: https://issues.apache.org/jira/browse/AIRFLOW-2407
> Project: Apache Airflow
> Issue Type: Bug
> Reporter: cclauss
> Priority: Minor
> Fix For: 2.0.0
>
> Original Estimate: 336h
> Remaining Estimate: 336h
>
> flake8 testing of https://github.com/apache/incubator-airflow on Python 3.6.3
> $ *flake8 . --count --select=E901,E999,F821,F822,F823 --show-source
> --statistics*
> {noformat}
> ./airflow/contrib/auth/backends/kerberos_auth.py:67:13: F821 undefined name
> 'logging'
> logging.error('Password validation for principal %s failed %s',
> user_principal, e)
> ^
> ./airflow/contrib/hooks/aws_hook.py:75:13: F821 undefined name 'logging'
> logging.warning("Option Error in parsing s3 config file")
> ^
> ./airflow/contrib/operators/datastore_export_operator.py:105:19: F821
> undefined name 'AirflowException'
> raise AirflowException('Operation failed:
> result={}'.format(result))
> ^
> ./airflow/contrib/operators/datastore_import_operator.py:94:19: F821
> undefined name 'AirflowException'
> raise AirflowException('Operation failed:
> result={}'.format(result))
> ^
> ./airflow/contrib/sensors/qubole_sensor.py:62:9: F821 undefined name 'this'
> this.log.info('Poking: %s', self.data)
> ^
> ./airflow/contrib/sensors/qubole_sensor.py:68:13: F821 undefined name
> 'logging'
> logging.exception(e)
> ^
> ./airflow/contrib/sensors/qubole_sensor.py:71:9: F821 undefined name 'this'
> this.log.info('Status of this Poke: %s', status)
> ^
> ./airflow/www/app.py:148:17: F821 undefined name 'reload'
> reload(e)
> ^
> ./tests/operators/hive_operator.py:178:27: F821 undefined name 'cursor_mock'
> __enter__=cursor_mock,
> ^
> ./tests/operators/hive_operator.py:184:27: F821 undefined name 'get_conn_mock'
> __enter__=get_conn_mock,
> ^
> ./tests/operators/test_virtualenv_operator.py:166:19: F821 undefined name
> 'virtualenv_string_args'
> print(virtualenv_string_args)
> ^
> ./tests/operators/test_virtualenv_operator.py:167:16: F821 undefined name
> 'virtualenv_string_args'
> if virtualenv_string_args[0] != virtualenv_string_args[2]:
> ^
> ./tests/operators/test_virtualenv_operator.py:167:45: F821 undefined name
> 'virtualenv_string_args'
> if virtualenv_string_args[0] != virtualenv_string_args[2]:
> ^
> 13 F821 undefined name 'logging'
> 13
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)