zhutong6688 commented on code in PR #32556:
URL: https://github.com/apache/superset/pull/32556#discussion_r1986526448


##########
superset/daos/database.py:
##########
@@ -166,6 +170,37 @@ def get_ssh_tunnel(cls, database_id: int) -> SSHTunnel | 
None:
 
         return ssh_tunnel
 
+    @classmethod
+    def is_odps_partitioned_table(
+        cls, database: Database, table_name: str
+    ) -> Tuple[bool, List[str]]:
+        """
+        This function is used to determine and retrieve
+        partition information of the odsp table.
+        The return values are whether the partition
+        table is partitioned and the names of all partition fields.
+        """
+        if not database:
+            raise ValueError("Database not found")
+        uri = database.sqlalchemy_uri
+        access_key = database.password
+        pattern = re.compile(
+            
r"odps://(?P<username>[^:]+):(?P<password>[^@]+)@(?P<project>[^/]+)/(?:\?endpoint=(?P<endpoint>[^&]+))"
+        )
+        if match := pattern.match(unquote(uri)):

Review Comment:
   This regular expression is designed to retrieve the corresponding connection 
information from the URL of odps, and this is the purpose of this regular 
expression



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

To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to