hainenber commented on code in PR #32310: URL: https://github.com/apache/superset/pull/32310#discussion_r1962838802
########## superset/daos/database.py: ########## @@ -165,7 +168,30 @@ 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): + if not database: + raise ValueError("Database not found") + uri = database.sqlalchemy_uri + passwd = database.password + pattern = re.compile( + r'odps://(?P<username>[^:]+):(?P<password>[^@]+)@(?P<project>[^/]+)/(?:\?endpoint=(?P<endpoint>[^&]+))' + ) + match = pattern.match(unquote(uri)) + if match: + access_id = match.group('username') + project = match.group('project') + endpoint = match.group('endpoint') + access_key = passwd Review Comment: Are there any benefits aside of readability? I'm not holding strong opinion on this but feels like this assignment is a bit excessive. -- 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