fix(migration): replace unquote with double percentages (#30532)
This commit is contained in:
parent
a098809294
commit
163b71e019
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue