Skip to content

Commit

Permalink
fix(migration): replace unquote with double percentages (apache#30532)
Browse files Browse the repository at this point in the history
(cherry picked from commit 163b71e)
  • Loading branch information
villebro authored and sadpandajoe committed Oct 7, 2024
1 parent 9f5f089 commit d0def80
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions superset/migrations/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# under the License.
import logging
import time
import urllib.parse
from logging.config import fileConfig

from alembic import context
Expand All @@ -43,8 +42,9 @@
"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


Expand Down

0 comments on commit d0def80

Please sign in to comment.