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 2019/12/17 07:18:56 UTC

[GitHub] [incubator-superset] mistercrunch commented on a change in pull request #8810: factor out database model

mistercrunch commented on a change in pull request #8810: factor out database model
URL: https://github.com/apache/incubator-superset/pull/8810#discussion_r358632634
 
 

 ##########
 File path: superset/models/database.py
 ##########
 @@ -0,0 +1,601 @@
+# 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 json
+import logging
+import textwrap
+from contextlib import closing
+from copy import deepcopy
+from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type
+
+# pylint: disable=ungrouped-imports
+import numpy
+import pandas as pd
+import sqlalchemy as sqla
+import sqlparse
+from flask import g, request
+from flask_appbuilder import Model
+from sqlalchemy import (
+    Boolean,
+    Column,
+    create_engine,
+    Integer,
+    MetaData,
+    String,
+    Table,
+    Text,
+    UniqueConstraint,
+)
+from sqlalchemy.engine import Dialect, Engine, url
+from sqlalchemy.engine.reflection import Inspector
+from sqlalchemy.engine.url import make_url, URL
+from sqlalchemy.pool import NullPool
+from sqlalchemy.sql import Select
+from sqlalchemy_utils import EncryptedType
+
+from superset import db_engine_specs, security_manager
+from superset.db_engine_specs.base import TimeGrain
+from superset.models.core import (
+    config,
+    custom_password_store,
 
 Review comment:
   To pass the failing unit test, I think the function definition for `custom_password_store` should be brought in from `superset.models.core` to this very location, and the test should target this function definition here in this module after it gets moved.
   
   Ultimately we need to improve the `config` handling in tests (allowing tests to temporary alter configs during the scope of a unit test), but in the meantime for the sake of this PR, moving the definition and test monkey patch is probably ok.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org