File tree Expand file tree Collapse file tree 3 files changed +35
-1
lines changed
Expand file tree Collapse file tree 3 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ Source code is also available at:
2121 - Refactor column reflection internals into dedicated helpers to reduce complexity without changing behavior.
2222 - Add ` pytest-xdist ` parallel test support via per-worker schema provisioning hooks.
2323- Bump ` pandas ` lower bound in ` sa14 ` test environment from ` <2.1 ` to ` >=2.1.1,<2.2 ` to ensure pre-built wheels are available for Python 3.12
24+ - Fix SQLAlchemy version parsing (SNOW-3066571)
2425
2526# Release Notes
2627
Original file line number Diff line number Diff line change 1111string_types = (str ,)
1212returns_unicode = util .symbol ("RETURNS_UNICODE" )
1313
14- IS_VERSION_20 = tuple (int (v ) for v in SA_VERSION .split ("." )) >= (2 , 0 , 0 )
14+ IS_VERSION_20 = tuple (int (v ) for v in SA_VERSION .split ("." )[: 2 ] ) >= (2 , 0 )
1515
1616
1717def args_reducer (positions_to_drop : tuple ):
Original file line number Diff line number Diff line change 1+ #
2+ # Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
3+ #
4+ import importlib
5+
6+ import pytest
7+
8+ import snowflake .sqlalchemy .compat as compat_module
9+
10+
11+ @pytest .fixture (scope = "session" , autouse = True )
12+ def init_test_schema ():
13+ """Neutralize the fixture that requires a live db connection."""
14+ yield
15+
16+
17+ @pytest .mark .parametrize (
18+ ("version" , "expected" ),
19+ [
20+ ("2.0.0" , True ),
21+ ("3.1.0" , True ),
22+ ("1.3.0" , False ),
23+ ("2.0.5.post1" , True ),
24+ ("2.0.0rc2" , True ),
25+ ("2.0.0b1" , True ),
26+ ("0.5.0beta3" , False ),
27+ ("0.4.2a" , False ),
28+ ],
29+ )
30+ def test_is_version_20 (version , expected , monkeypatch ):
31+ monkeypatch .setattr ("sqlalchemy.__version__" , version )
32+ importlib .reload (compat_module )
33+ assert compat_module .IS_VERSION_20 == expected
You can’t perform that action at this time.
0 commit comments