Skip to content

Commit 6047713

Browse files
committed
Upgrade to snowflake-connector-python 4.0.0 and use ocsp_root_certs_dict_lock_timeout=10
1 parent f60fb98 commit 6047713

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

dbt-snowflake/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies = [
2626
"dbt-common>=1.10,<2.0",
2727
"dbt-adapters>=1.16.6,<2.0",
2828
# lower bound pin due to CVE-2025-24794
29-
"snowflake-connector-python[secure-local-storage]>=3.13.1,<4.0.0",
29+
"snowflake-connector-python[secure-local-storage]>=4.0.0,<5.0.0",
3030
"certifi<2025.4.26",
3131
# add dbt-core to ensure backwards compatibility of installation, this is not a functional dependency
3232
"dbt-core>=1.10.0rc0",

dbt-snowflake/src/dbt/adapters/snowflake/connections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ def connect():
394394
application="dbt",
395395
insecure_mode=creds.insecure_mode,
396396
session_parameters=session_parameters,
397-
client_prefetch_threads=1, # disable client prefetch because it can cause deadlock at exit, see https://github.com/snowflakedb/snowflake-connector-python/issues/2213
397+
ocsp_root_certs_dict_lock_timeout=10, # cert lock can cause deadlock without timeout, see https://github.com/snowflakedb/snowflake-connector-python/issues/2213
398398
**creds.auth_args(),
399399
)
400400

dbt-snowflake/tests/unit/test_snowflake_adapter.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def test_client_session_keep_alive_false_by_default(self):
292292
insecure_mode=False,
293293
session_parameters={},
294294
reuse_connections=True,
295-
client_prefetch_threads=1,
295+
ocsp_root_certs_dict_lock_timeout=10,
296296
),
297297
]
298298
)
@@ -326,7 +326,7 @@ def test_client_session_keep_alive_true(self):
326326
insecure_mode=False,
327327
session_parameters={},
328328
reuse_connections=None,
329-
client_prefetch_threads=1,
329+
ocsp_root_certs_dict_lock_timeout=10,
330330
)
331331
]
332332
)
@@ -354,7 +354,7 @@ def test_client_has_query_tag(self):
354354
application="dbt",
355355
insecure_mode=False,
356356
session_parameters={"QUERY_TAG": "test_query_tag"},
357-
client_prefetch_threads=1,
357+
ocsp_root_certs_dict_lock_timeout=10,
358358
)
359359
]
360360
)
@@ -390,7 +390,7 @@ def test_user_pass_authentication(self):
390390
insecure_mode=False,
391391
session_parameters={},
392392
reuse_connections=True,
393-
client_prefetch_threads=1,
393+
ocsp_root_certs_dict_lock_timeout=10,
394394
)
395395
]
396396
)
@@ -425,7 +425,7 @@ def test_authenticator_user_pass_authentication(self):
425425
insecure_mode=False,
426426
session_parameters={},
427427
reuse_connections=True,
428-
client_prefetch_threads=1,
428+
ocsp_root_certs_dict_lock_timeout=10,
429429
)
430430
]
431431
)
@@ -456,7 +456,7 @@ def test_authenticator_externalbrowser_authentication(self):
456456
insecure_mode=False,
457457
session_parameters={},
458458
reuse_connections=True,
459-
client_prefetch_threads=1,
459+
ocsp_root_certs_dict_lock_timeout=10,
460460
)
461461
]
462462
)
@@ -491,7 +491,7 @@ def test_authenticator_oauth_authentication(self):
491491
insecure_mode=False,
492492
session_parameters={},
493493
reuse_connections=True,
494-
client_prefetch_threads=1,
494+
ocsp_root_certs_dict_lock_timeout=10,
495495
)
496496
]
497497
)
@@ -526,7 +526,7 @@ def test_authenticator_private_key_authentication(self, mock_get_private_key):
526526
insecure_mode=False,
527527
session_parameters={},
528528
reuse_connections=True,
529-
client_prefetch_threads=1,
529+
ocsp_root_certs_dict_lock_timeout=10,
530530
)
531531
]
532532
)
@@ -561,7 +561,7 @@ def test_authenticator_private_key_authentication_no_passphrase(self, mock_get_p
561561
insecure_mode=False,
562562
session_parameters={},
563563
reuse_connections=True,
564-
client_prefetch_threads=1,
564+
ocsp_root_certs_dict_lock_timeout=10,
565565
)
566566
]
567567
)
@@ -594,7 +594,7 @@ def test_authenticator_jwt_authentication(self):
594594
insecure_mode=False,
595595
session_parameters={},
596596
reuse_connections=True,
597-
client_prefetch_threads=1,
597+
ocsp_root_certs_dict_lock_timeout=10,
598598
)
599599
]
600600
)
@@ -625,7 +625,7 @@ def test_query_tag(self):
625625
insecure_mode=False,
626626
session_parameters={"QUERY_TAG": "test_query_tag"},
627627
reuse_connections=True,
628-
client_prefetch_threads=1,
628+
ocsp_root_certs_dict_lock_timeout=10,
629629
)
630630
]
631631
)
@@ -655,7 +655,7 @@ def test_reuse_connections_with_keep_alive(self):
655655
insecure_mode=False,
656656
session_parameters={},
657657
reuse_connections=True,
658-
client_prefetch_threads=1,
658+
ocsp_root_certs_dict_lock_timeout=10,
659659
)
660660
]
661661
)
@@ -690,7 +690,7 @@ def test_authenticator_private_key_string_authentication(self, mock_get_private_
690690
insecure_mode=False,
691691
session_parameters={},
692692
reuse_connections=True,
693-
client_prefetch_threads=1,
693+
ocsp_root_certs_dict_lock_timeout=10,
694694
)
695695
]
696696
)
@@ -727,7 +727,7 @@ def test_authenticator_private_key_string_authentication_no_passphrase(
727727
insecure_mode=False,
728728
session_parameters={},
729729
reuse_connections=True,
730-
client_prefetch_threads=1,
730+
ocsp_root_certs_dict_lock_timeout=10,
731731
)
732732
]
733733
)

0 commit comments

Comments
 (0)