Skip to content

Commit

Permalink
Revert "fix: check type of url before performing string actions (apac…
Browse files Browse the repository at this point in the history
…he#19569)"

This reverts commit 6b3cd10.
  • Loading branch information
sadpandajoe committed Apr 7, 2022
1 parent 6b3cd10 commit f1b1dd3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 61 deletions.
22 changes: 1 addition & 21 deletions superset/databases/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# 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, Union
from typing import Any, Dict, List, Optional

from superset import app
from superset.models.core import Database
Expand Down Expand Up @@ -101,23 +101,3 @@ def get_table_metadata(
"indexes": keys,
"comment": table_comment,
}


def make_url_safe(raw_url: Union[str, URL]) -> URL:
"""
Wrapper for SQLAlchemy's make_url(), which tends to raise too detailed of
errors, which inevitably find their way into server logs. ArgumentErrors
tend to contain usernames and passwords, which makes them non-log-friendly
:param raw_url:
:return:
"""

if isinstance(raw_url, str):
url = raw_url.strip()
try:
return make_url(url) # noqa
except Exception:
raise DatabaseInvalidError() # pylint: disable=raise-missing-from

else:
return raw_url
40 changes: 0 additions & 40 deletions tests/unit_tests/databases/utils_test.py

This file was deleted.

0 comments on commit f1b1dd3

Please sign in to comment.