Skip to content

Commit

Permalink
fix(migration): replace unquote with double percentages
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro committed Oct 6, 2024
1 parent bc8e951 commit 0242f31
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)

Check warning on line 47 in superset/migrations/env.py

View check run for this annotation

Codecov / codecov/patch

superset/migrations/env.py#L46-L47

Added lines #L46 - L47 were not covered by tests
target_metadata = Base.metadata # pylint: disable=no-member


Expand Down

0 comments on commit 0242f31

Please sign in to comment.