Skip to content

Commit c082f40

Browse files
removed caching off the function to test if that is what is causing failures
1 parent 787ffe7 commit c082f40

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/snowflake/connector/platform_detection.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
import re
55
from concurrent.futures.thread import ThreadPoolExecutor
66
from enum import Enum
7-
from functools import cache
87

98
import boto3
109
from botocore.config import Config
1110
from botocore.utils import IMDSFetcher
1211

1312
from .vendored import requests
1413

14+
# TODO: add this back
15+
# from functools import cache
16+
1517

1618
class _DetectionState(Enum):
1719
"""Internal enum to represent the detection state of a platform."""
@@ -359,7 +361,8 @@ def is_github_action():
359361
)
360362

361363

362-
@cache
364+
# TODO: add cache back in once I verify this is the root cause issue
365+
# @cache
363366
def detect_platforms(timeout_seconds: float | None) -> list[str]:
364367
"""
365368
Detect all potential platforms that the current environment may be running on.

test/unit/test_detect_platforms.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ def build_response(status_code=200, headers=None):
1414

1515

1616
class TestDetectPlatforms:
17-
@pytest.fixture(autouse=True)
18-
def teardown(self):
19-
yield
20-
detect_platforms.cache_clear() # clear cache after each test
17+
# TODO: add this back probably once I verify caching is causing the test failures
18+
# @pytest.fixture(autouse=True)
19+
# def teardown(self):
20+
# yield
21+
# detect_platforms.cache_clear() # clear cache after each test
2122

2223
def test_no_platforms_detected(self, broken_metadata_service):
2324
result = detect_platforms(timeout_seconds=None)

0 commit comments

Comments
 (0)