HUE-7728 [jb] Do not error in the SQL query browser when pointing to an old Impala

Review Request #12328 - Created Jan. 10, 2018 and submitted

Romain Rigaux
hue
master
HUE-7728
hue
enricoberti, jgauthier, johan, ranade, roohi, weixia, yingc
commit 9a65990b8fcffdc78d3e693aaf1cef1dee752c20
Author: Romain Rigaux <romain@cloudera.com>
Date:   Wed Jan 10 14:30:38 2018 -0800

    HUE-7728 [jb] Do not error in the SQL query browser when pointing to an old Impala
    
    Avoid:
    [10/Jan/2018 14:24:49 +0000] api2         ERROR    Error running <function job at 0x7f29de1c2410>
    Traceback (most recent call last):
      File "/home/romain/projects/hue/apps/jobbrowser/src/jobbrowser/api2.py", line 38, in decorator
        return func(*args, **kwargs)
      File "/home/romain/projects/hue/apps/jobbrowser/src/jobbrowser/api2.py", line 73, in job
        response_app = get_api(request.user, interface).app(app_id)
      File "/home/romain/projects/hue/apps/jobbrowser/src/jobbrowser/apis/query_api.py", line 108, in app
        'text': 'id:' + appid
      File "/home/romain/projects/hue/apps/jobbrowser/src/jobbrowser/apis/query_api.py", line 76, in apps
        } for job in jobs_iter_filtered], key=lambda job: job.get('submitted'), reverse=True),
    KeyError: 'resource_pool'

:100644 100644 58ec55a... 1ac9556... M	apps/jobbrowser/src/jobbrowser/apis/query_api.py

manual

  • 2
  • 0
  • 0
  • 0
  • 2
Description From Last Updated
How is this different? And if you are accessing using python dictionary "get" method then better you put default value? Prakash Ranade
How is this different? And if you are accessing using python dictionary "get" method then better you put default value? Prakash Ranade
  1. Ship It!
  2. 
      
  1. 
      
  2. How is this different? And if you are accessing using python dictionary "get" method then better you put default value?

    1. get will default to None if there is no value: https://docs.python.org/2/library/stdtypes.html#dict.get

  3. How is this different? And if you are accessing using python dictionary "get" method then better you put default value?

  4. 
      
Review request changed

Status: Closed (submitted)

Loading...