HUE-8737 [core] Fix post-futurized code

Review Request #13857 - Created April 17, 2019 and updated

Ying Chen
hue
ying-python3
hue
jgauthier, johan, ranade, romain, weixia
commit 1575c6c226e879bc769648fe58d1964a5ab11d3c
Author: Ying Chen <yingchen@cloudera.com>
Date:   Tue Apr 9 14:54:58 2019 -0700

    [core] Fix post-futurized code
    * apps/beeswax
    * apps/oozie
    * apps/zookeeper
    * desktop/core/src/desktop/lib
    * desktop/libs
    * tools/app_reg and supervisor.py file NameError

:100644 100644 f890c8b... c0e1992... M	apps/beeswax/src/beeswax/hive_site.py
:100644 100644 65c11ee... 6e6009f... M	apps/beeswax/src/beeswax/server/dbms.py
:100644 100644 5499cea... b754c13... M	apps/oozie/src/oozie/models.py
:100644 100644 7b95577... b1ca602... M	apps/oozie/src/oozie/models2.py
:100644 100644 a4b9c61... de200e3... M	apps/zookeeper/src/zookeeper/stats.py
:100644 100644 4ebec2b... f4ac3ad... M	desktop/core/src/desktop/lib/conf.py
:100644 100644 83d5d8a... 01a7467... M	desktop/core/src/desktop/lib/django_forms.py
:100644 100644 7e78ee7... a3c6833... M	desktop/core/src/desktop/lib/exceptions_renderable.py
:100644 100644 9bd5e59... dfb502a... M	desktop/core/src/desktop/lib/fsmanager.py
:100644 100644 4dd5ba2... 7109529... M	desktop/core/src/desktop/lib/i18n.py
:100644 100644 166bdaf... 22d3668... M	desktop/core/src/desktop/log/__init__.py
:100644 100644 23c0037... 760e2cf... M	desktop/core/src/desktop/settings.py
:100644 100644 6046584... 7f1d282... M	desktop/core/src/desktop/supervisor.py
:100644 100644 f8fa071... 55e7e08... M	desktop/libs/aws/src/aws/s3/__init__.py
:100644 100644 9af9cdd... 89373af... M	desktop/libs/dashboard/src/dashboard/api.py
:100644 100644 9ae6473... 1fbb034... M	desktop/libs/hadoop/src/hadoop/cluster.py
:100644 100644 3676ee3... 2fa2457... M	desktop/libs/hadoop/src/hadoop/fs/hadoopfs.py
:100644 100644 3cc97c4... 47b3065... M	desktop/libs/hadoop/src/hadoop/fs/webhdfs.py
:100644 100644 6b7f065... ec3d307... M	desktop/libs/hadoop/src/hadoop/hdfs_site.py
:100755 100755 9602646... 70de97a... M	tools/app_reg/app_reg.py
:100644 100644 215a7f0... 23f4e25... M	tools/app_reg/registry.py


  • 11
  • 0
  • 0
  • 0
  • 11
Description From Last Updated
Need to close file; use with pattern: https://github.com/cloudera/hue/blob/master/desktop/libs/notebook/src/notebook/tasks.py#L282 Jean-Francois Desjeans Gauthier
Need to close file; use with pattern: https://github.com/cloudera/hue/blob/master/desktop/libs/notebook/src/notebook/tasks.py#L282 Jean-Francois Desjeans Gauthier
Add comment this is Python 2? Romain Rigaux
list() really needed? Romain Rigaux
Need to close file; use with pattern: https://github.com/cloudera/hue/blob/master/desktop/libs/notebook/src/notebook/tasks.py#L282 Jean-Francois Desjeans Gauthier
Remove of already removed in other commit? Romain Rigaux
Isn't open compatible with both? https://python-future.org/compatible_idioms.html#file-io-with-open Romain Rigaux
Need to protect this with with pattern or try finally close: https://github.com/cloudera/hue/blob/master/desktop/libs/notebook/src/notebook/tasks.py#L282 Jean-Francois Desjeans Gauthier
LOG.exception('...') ? Romain Rigaux
Need to close file. Use with pattern: https://github.com/cloudera/hue/blob/master/desktop/libs/notebook/src/notebook/tasks.py#L282 Jean-Francois Desjeans Gauthier
We should use with pattern to avoid files that are never closed: https://github.com/cloudera/hue/blob/master/desktop/libs/notebook/src/notebook/tasks.py#L282 Jean-Francois Desjeans Gauthier
  1. Nice, a few nits

  2. apps/beeswax/src/beeswax/server/dbms.py (Diff revision 1)
     
     

    Add comment this is Python 2?

  3. desktop/core/src/desktop/lib/conf.py (Diff revision 1)
     
     

    list() really needed?

  4. desktop/core/src/desktop/supervisor.py (Diff revision 1)
     
     

    Remove of already removed in other commit?

  5. desktop/core/src/desktop/supervisor.py (Diff revision 1)
     
     

    Isn't open compatible with both?

    https://python-future.org/compatible_idioms.html#file-io-with-open

  6. LOG.exception('...')

    ?

  7. 
      
  1. 
      
  2. apps/beeswax/src/beeswax/hive_site.py (Diff revision 1)
     
     

    Need to close file; use with pattern:
    https://github.com/cloudera/hue/blob/master/desktop/libs/notebook/src/notebook/tasks.py#L282

  3. apps/beeswax/src/beeswax/hive_site.py (Diff revision 1)
     
     

    Need to close file; use with pattern:
    https://github.com/cloudera/hue/blob/master/desktop/libs/notebook/src/notebook/tasks.py#L282

  4. Need to close file; use with pattern:
    https://github.com/cloudera/hue/blob/master/desktop/libs/notebook/src/notebook/tasks.py#L282

  5. Need to protect this with with pattern or try finally close:
    https://github.com/cloudera/hue/blob/master/desktop/libs/notebook/src/notebook/tasks.py#L282

  6. Need to close file. Use with pattern:
    https://github.com/cloudera/hue/blob/master/desktop/libs/notebook/src/notebook/tasks.py#L282

  7. tools/app_reg/registry.py (Diff revision 1)
     
     

    We should use with pattern to avoid files that are never closed:
    https://github.com/cloudera/hue/blob/master/desktop/libs/notebook/src/notebook/tasks.py#L282

  8. 
      
Loading...