snowflakedb / snowflakedb/snowflake-connector-python

SNOW-3880829: detect_platforms() is not cached as expected

Open
#2,983 2 comments 0 reactions 1 assignee View on GitHub

@sfc-gh-snow-drivers-warsaw-dl is already working on this.

Since Aug 11, 2026.

bug status-triage_done
Dominant language
Python
Stars
730
Forks
574
Avg merge
5h 45m
Merged PRs (30d)
16

Description

Python version

Python 3.11.6 (main, Nov 7 2023, 15:13:01) [GCC 11.4.0]

Operating system and processor architecture

Linux-6.8.0-124-generic-x86_64-with-glibc2.35

What did you do?

detect_platforms() is decorated with @functools.cache (platform_detection.py), so platform detection should run once per process. But the only call site passes a fresh SessionManager clone on every call (auth/_auth.py, Auth.base_auth_data):

"PLATFORM": detect_platforms(
    platform_detection_timeout_seconds=platform_detection_timeout_seconds,
    session_manager=session_manager.clone(max_retries=0),
),
What did you expect to see?

Detection runs once per process; subsequent connect() calls reuse the cached result.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.