Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: deprecate /superset/testconn and migrate to api v1 #20002

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion superset/templates/superset/models/database/macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
.append('<button id="testconn" class="btn btn-sm btn-primary">{{ _("Test Connection") }}</button>');
$("#testconn").click(function(e) {
e.preventDefault();
var url = "/superset/testconn";
var url = "/api/v1/database/test_connection";
var csrf_token = "{{ csrf_token() if csrf_token else '' }}";

$.ajaxSetup({
Expand Down
5 changes: 5 additions & 0 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1333,6 +1333,11 @@ def add_slices( # pylint: disable=no-self-use
@expose("/testconn", methods=["POST", "GET"])
def testconn(self) -> FlaskResponse: # pylint: disable=no-self-use
"""Tests a sqla connection"""
logger.warning(
"%s.testconn "
"This API endpoint is deprecated and will be removed in version 3.0.0",
self.__class__.__name__,
)
db_name = request.json.get("name")
uri = request.json.get("uri")
try:
Expand Down