ofekisr commented on a change in pull request #15578:
URL: https://github.com/apache/superset/pull/15578#discussion_r665727719
##########
File path: superset/db_engine_specs/gsheets.py
##########
@@ -33,6 +36,12 @@
SYNTAX_ERROR_REGEX = re.compile('SQLError: near "(?P<server_error>.*?)":
syntax error')
+class GSheetsParametersType(TypedDict):
Review comment:
be careful, TypedDict added in 3.8 so ... maybe the name should be
changed
##########
File path: tests/unit_tests/db_engine_specs/test_gsheets.py
##########
@@ -0,0 +1,177 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# pylint: disable=unused-argument, invalid-name
+from superset.errors import ErrorLevel, SupersetError, SupersetErrorType
+
+
+class ProgrammingError(Exception):
+ """
+ Dummy ProgrammingError so we don't need to import the optional gsheets.
+ """
+
+
+def test_validate_parameters_simple(mocker, app_context):
Review comment:
I recommend to put all your tests under a Class so you can organize them
more easily: skip, mark or annotate it with a fixture who will be applied for
all the tests there
##########
File path: tests/unit_tests/conftest.py
##########
@@ -0,0 +1,30 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import pytest
+
+from superset.app import create_app
Review comment:
> Ah, good catch. Will fix it. But keep in mind that just importing
`create_app` doesn't do any initialization, and the import is reasonably quick.
superset package will load superset extension and then it will load others
and initialize many objects there
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]