HUE-6005 [librdbms] Col details is empty for other than Hive and Impala

Review Request #10081 - Created April 10, 2017 and submitted

Adrian Yavorskyy
hue
master
hue
enricoberti, erickt, johan, romain
commit 7017108a898e7c472aafdb187f2efd161682f0ca
Author: Adrian Yavorskyy <ayav@softserveinc.com>
Date:   Mon Apr 10 12:51:56 2017 +0300

    HUE-6005 [librdbms] Col details is empty for other than Hive and Impala

:100644 100644 2b43325... 0eaa803... M	desktop/libs/notebook/src/notebook/connectors/rdbms.py
:100644 100644 6c7c6c8... 634eb13... M	desktop/libs/notebook/src/notebook/urls.py

Tested with Sqlite, MYSQL and Postgres.

  • 0
  • 0
  • 3
  • 0
  • 3
Description From Last Updated
  1. 
      
  2. Bit weird though, if we arrive in the else, it means
    if database is None:, if table is None:, so maybe change the else on line 140 to be

    if column is None:

    ?

  3. 
      
  1. 
      
  2. next([col['name'] for col in columns if column == col['name']], '')

    To protect against [0] erroring?

  3. 
      
  1. 
      
  2. next((col['name'] for col in columns if column == col['name']), '')

    ?

    1. I was thinking about this too, but it didn't work when I tried the first time.
      However it works ok. I will update a review.

  3. 
      
  1. It works because it uses () for creating a generator and not [] for a list ;)

    1. Thanks Romain !
      A patch is attached !

  2. 
      
Review request changed

Status: Closed (submitted)

Loading...