Skip to content

SNOW-679045: _rfc_1738_quote is no longer available in sqlalchemy 1.4.42 #351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ repos:
- id: flake8
additional_dependencies:
- flake8-bugbear == 20.11.1
- importlib_metadata == 4.13.0
1 change: 1 addition & 0 deletions DESCRIPTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Source code is also available at:

- v1.4.3(Unreleased)
- Fixed a bug that `SnowflakeDialect.normalize_name` and `SnowflakeDialect.denormalize_name` could not handle empty string.
- Fixed a compatibility issue to vendor function `sqlalchemy.engine.url._rfc_1738_quote` as it is removed from SQLAlchemy v1.4.42.

- v1.4.2(Sep 19, 2022)

Expand Down
6 changes: 5 additions & 1 deletion src/snowflake/sqlalchemy/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@
# Copyright (c) 2012-2022 Snowflake Computing Inc. All rights reserved.
#

import re
from urllib.parse import quote_plus

from sqlalchemy import exc
from sqlalchemy.engine.url import _rfc_1738_quote

from snowflake.connector.compat import IS_STR


def _rfc_1738_quote(text):
return re.sub(r"[:@/]", lambda m: "%%%X" % ord(m.group(0)), text)


def _url(**db_parameters):
"""
Composes a SQLAlchemy connect string from the given database connection
Expand Down