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/22 18:18:21 UTC

[GitHub] [incubator-superset] dpgaspar commented on a change in pull request #9599: chore: Improve chart data API + schemas + tests

dpgaspar commented on a change in pull request #9599:
URL: https://github.com/apache/incubator-superset/pull/9599#discussion_r413208458



##########
File path: tests/base_tests.py
##########
@@ -127,21 +129,25 @@ def login(self, username="admin", password="general"):
         resp = self.get_resp("/login/", data=dict(username=username, password=password))
         self.assertNotIn("User confirmation needed", resp)
 
-    def get_slice(self, slice_name, session):
+    def get_slice(self, slice_name: str, session: Session) -> Slice:
         slc = session.query(Slice).filter_by(slice_name=slice_name).one()
         session.expunge_all()
         return slc
 
-    def get_table_by_name(self, name):
+    @staticmethod
+    def get_table_by_name(name: str) -> SqlaTable:
         return db.session.query(SqlaTable).filter_by(table_name=name).one()
 
-    def get_database_by_id(self, db_id):
+    @staticmethod
+    def get_database_by_id(db_id: int) -> Database:
         return db.session.query(Database).filter_by(id=db_id).one()
 
-    def get_druid_ds_by_name(self, name):
+    @staticmethod
+    def get_druid_ds_by_name(name: str) -> DruidDatasource:
         return db.session.query(DruidDatasource).filter_by(datasource_name=name).first()
 
-    def get_datasource_mock(self):
+    @staticmethod
+    def get_datasource_mock():

Review comment:
       nit: Missing return type annotation

##########
File path: tests/query_context_tests.py
##########
@@ -0,0 +1,94 @@
+# Licensed to the Apache Software Foundation (ASF) under one

Review comment:
       Would it make sense to place this on /tests/charts/query_context_tests ?




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