john-bodley commented on a change in pull request #7374: [fix] Fixing SQL 
parsing issue
URL: 
https://github.com/apache/incubator-superset/pull/7374#discussion_r278319961
 
 

 ##########
 File path: superset/sql_parse.py
 ##########
 @@ -144,10 +144,11 @@ def __extract_from_token(self, token, depth=0):
 
             if table_name_preceding_token:
                 if isinstance(item, Identifier):
-                    self.__process_identifier(item)
+                    self.__process_tokenlist(item)
                 elif isinstance(item, IdentifierList):
                     for token in item.get_identifiers():
-                        self.__process_identifier(token)
+                        if isinstance(token, TokenList):
 
 Review comment:
   There's no guarantee that the "identifiers" associated withe 
[`get_indentifiers`](https://github.com/andialbrecht/sqlparse/blob/master/sqlparse/sql.py#L470)
 (possibly poorly named) are of type `Identifier` and thus the additional check 
to verify that the token is an instance of `TokenList` is required.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to