fix(migration): replace unquote with double percentages (#30532)

This commit is contained in:
Ville Brofeldt 2024-10-06 20:05:20 -07:00 committed by GitHub
parent a098809294
commit 163b71e019
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,6 @@
# under the License.
import logging
import time
import urllib.parse
from logging.config import fileConfig
from alembic import context
@ -43,8 +42,9 @@ if "sqlite" in DATABASE_URI:
"SQLite Database support for metadata databases will \
be removed in a future version of Superset."
)
decoded_uri = urllib.parse.unquote(DATABASE_URI)
config.set_main_option("sqlalchemy.url", decoded_uri)
# Escape % chars in the database URI to avoid interpolation errors in ConfigParser
escaped_uri = DATABASE_URI.replace("%", "%%")
config.set_main_option("sqlalchemy.url", escaped_uri)
target_metadata = Base.metadata # pylint: disable=no-member