villebro commented on a change in pull request #8098: [Hive Engine Spec] Fix 
latest partition logic
URL: 
https://github.com/apache/incubator-superset/pull/8098#discussion_r316971485
 
 

 ##########
 File path: superset/db_engine_specs/hive.py
 ##########
 @@ -299,16 +299,19 @@ def get_columns(
     @classmethod
     def where_latest_partition(cls, table_name, schema, database, qry, 
columns=None):
         try:
-            col_name, value = cls.latest_partition(
+            col_names, values = cls.latest_partition(
                 table_name, schema, database, show_first=True
             )
         except Exception:
             # table is not partitioned
             return False
-        if value is not None:
-            for c in columns:
-                if c.get("name") == col_name:
-                    return qry.where(Column(col_name) == value)
+        if values is not None:
+            for col_name, value in zip(col_names, values):
+                for c in columns:
+                    if c.get("name") == col_name:
+                        qry = qry.where(Column(col_name) == value)
+
+            return qry
         return False
 
 Review comment:
   `return None`?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to