You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/04/29 17:37:58 UTC

[GitHub] [incubator-superset] villebro commented on a change in pull request #9649: [sql] Adding lightweight Table class for SQL parsing

villebro commented on a change in pull request #9649:
URL: https://github.com/apache/incubator-superset/pull/9649#discussion_r417493073



##########
File path: superset/sql_parse.py
##########
@@ -57,10 +58,30 @@ def _extract_limit_from_query(statement: TokenList) -> Optional[int]:
     return None
 
 
+@dataclass(eq=True, frozen=True)
+class Table:  # pylint: disable=too-few-public-methods
+    """
+    A fully specified SQL table conforming to [[catalog.]schema.]table.
+    """
+
+    table: str
+    schema: Optional[str] = None
+    catalog: Optional[str] = None
+
+    def __str__(self) -> str:

Review comment:
       I agree, I didn't realize `dataclass` adds such an intuitive `__repr__`




----------------------------------------------------------------
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:
users@infra.apache.org



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