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/09/01 23:23:37 UTC

[GitHub] [incubator-superset] dpgaspar commented on a change in pull request #10741: feat(database): POST, PUT, DELETE API endpoints

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



##########
File path: superset/databases/api.py
##########
@@ -14,126 +14,78 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-from typing import Any, Dict, List, Optional
+import logging
+from typing import Any, Optional
 
+from flask import g, request, Response
 from flask_appbuilder.api import expose, protect, rison, safe
 from flask_appbuilder.models.sqla.interface import SQLAInterface
+from marshmallow import ValidationError
 from sqlalchemy.exc import NoSuchTableError, OperationalError, SQLAlchemyError
 
 from superset import event_logger
+from superset.constants import RouteMethod
+from superset.databases.commands.create import CreateDatabaseCommand
+from superset.databases.commands.delete import DeleteDatabaseCommand
+from superset.databases.commands.exceptions import (
+    DatabaseCreateFailedError,
+    DatabaseDeleteDatasetsExistFailedError,
+    DatabaseDeleteFailedError,
+    DatabaseInvalidError,
+    DatabaseNotFoundError,
+    DatabaseUpdateFailedError,
+)
+from superset.databases.commands.update import UpdateDatabaseCommand
 from superset.databases.decorators import check_datasource_access
+from superset.databases.filters import DatabaseFilter
 from superset.databases.schemas import (
     database_schemas_query_schema,
+    DatabasePostSchema,
+    DatabasePutSchema,
     SchemasResponseSchema,
     SelectStarResponseSchema,
     TableMetadataResponseSchema,
 )
+from superset.databases.utils import get_table_metadata
 from superset.extensions import security_manager
 from superset.models.core import Database
 from superset.typing import FlaskResponse
 from superset.utils.core import error_msg_from_exception
 from superset.views.base_api import BaseSupersetModelRestApi, statsd_metrics
-from superset.views.database.filters import DatabaseFilter
-from superset.views.database.validators import sqlalchemy_uri_validator

Review comment:
       Moved this to `superset/databases/utils.py` since they are utility/helper functions




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