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/07/03 06:14:11 UTC

[GitHub] [incubator-superset] villebro commented on a change in pull request #10084: fix: Fixed bug for issue #9967 ( Hive date functions for group functions in charts )

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



##########
File path: tests/db_engine_specs/hive_tests.py
##########
@@ -153,6 +157,20 @@ def test_hive_get_view_names_return_empty_list(
             [], HiveEngineSpec.get_view_names(mock.ANY, mock.ANY, mock.ANY)
         )
 
+    def test_time_exp_mixd_case_col_1y(self):
+        # pylint: disable=line-too-long
+        # pylint: disable=invalid-name
+        """
+        DB Eng Specs (hive): Test grain expr mixed case 1 YEAR
+        """
+        col = column("MixedCase")
+        expr = HiveEngineSpec.get_timestamp_expr(col, None, "P1Y")
+        result = str(expr.compile(None, dialect=hive.dialect()))

Review comment:
       I'm not sure how we've usually handled Sql Alchemy plugin dialects in tests, but I think this needs to check if `hive` is available, and only run the test if that is the case.

##########
File path: tests/db_engine_specs/hive_tests.py
##########
@@ -16,6 +16,10 @@
 # under the License.
 from unittest import mock
 
+from pyhive import hive
+from sqlalchemy import column
+from sqlalchemy.dialects import *

Review comment:
       Is this import really needed? It seems none of the standard Sql Alchemy dialects are used here.




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