etr2460 commented on a change in pull request #8058: Add docstrings and typing 
to db_engine_specs and sql_parse
URL: 
https://github.com/apache/incubator-superset/pull/8058#discussion_r315417347
 
 

 ##########
 File path: superset/db_engine_specs/presto.py
 ##########
 @@ -944,22 +955,22 @@ def where_latest_partition(cls, table_name, schema, 
database, qry, columns=None)
         column_names = {column.get("name") for column in columns or []}
         for col_name, value in zip(col_names, values):
             if col_name in column_names:
-                qry = qry.where(Column(col_name) == value)
-        return qry
+                query = query.where(Column(col_name) == value)
+        return query
 
     @classmethod
     def _latest_partition_from_df(cls, df):
         if not df.empty:
             return df.to_records(index=False)[0].item()
 
     @classmethod
-    def latest_partition(cls, table_name, schema, database, show_first=False):
+    def latest_partition(
+        cls, table_name: str, schema: str, database, show_first: bool = False
+    ) -> Tuple[str, str]:
 
 Review comment:
   This typing isn't quite right here:
   
   I believe we return a `Tuple[List[str], Optional[List[str]]]`
   
   `column_names` is a list (as we call `len` on it) and the second piece of 
the tuple can be `None` (see method above)

----------------------------------------------------------------
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