Skip to content

fix(psycopg): add platform guard for platforms without AF_UNIX support - #1466

Merged
kgala2 merged 1 commit into
GoogleCloudPlatform:mainfrom
kgala2:fix-psycopg-windows
Aug 15, 2026
Merged

fix(psycopg): add platform guard for platforms without AF_UNIX support#1466
kgala2 merged 1 commit into
GoogleCloudPlatform:mainfrom
kgala2:fix-psycopg-windows

Conversation

@kgala2

@kgala2 kgala2 commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Adds hasattr(socket, "AF_UNIX") guard to google/cloud/sql/connector/psycopg.py to raise NotImplementedError on platforms that do not support Unix domain sockets (such as Windows).
  • Adds pytestmark skip guards to tests/system/test_psycopg_connection.py and tests/system/test_psycopg_iam_auth.py so system tests do not fail with AttributeError on Windows test runners.
  • Adds test_connect_unsupported_platform unit test to tests/unit/test_psycopg.py.

Testing

  • Unit tests: All 197 unit tests passed.
  • Linting: ruff check and mypy passed with zero errors.
  • Packaging: build --sdist and twine check --strict passed.

@kgala2
kgala2 requested a review from a team as a code owner August 14, 2026 22:45
@kgala2
kgala2 enabled auto-merge (squash) August 14, 2026 23:18
@kgala2
kgala2 merged commit 2dfee66 into GoogleCloudPlatform:main Aug 15, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants