craig-rueda commented on a change in pull request #9054: [database] new, select 
star API migration
URL: 
https://github.com/apache/incubator-superset/pull/9054#discussion_r374406456
 
 

 ##########
 File path: superset/views/database/api.py
 ##########
 @@ -262,19 +265,74 @@ def table_metadata(
             500:
               $ref: '#/components/responses/500'
         """
-        table_name_parsed = parse_js_uri_path_item(table_name)
-        schema_parsed = parse_js_uri_path_item(schema_name, 
eval_undefined=True)
-        # schemas can be None but not tables
-        if not table_name_parsed:
-            return self.response_422(message=_(f"Could not parse table name or 
schema"))
-        database: Database = self.datamodel.get(pk, self._base_filters)
-        if not database:
-            return self.response_404()
-
+        self.stats_logger.incr(f"init_{self.__class__.__name__}.table")
 
 Review comment:
   Maybe DRY this stats incrementing up a bit? At the moment, there's quite a 
bit of duplication in terms of reliance on a well-known string format. If maybe 
just create a func like
   
   ```
   def inc_stat(self, prefix: str, suffix: str) -> None:
       self.stats_logger.incr(f"{prefix}_{self.__class__.__name__}.{suffix}")
   ```
   
   Thoughts?

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