Merged
Conversation
There was a problem hiding this comment.
1 issue found across 15 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="drift/instrumentation/psycopg2/instrumentation.py">
<violation number="1" location="drift/instrumentation/psycopg2/instrumentation.py:846">
P2: Removing `strict=True` from `zip(column_names, row)` now hides row/column length mismatches, potentially returning truncated or misaligned dict rows instead of raising an error. Add an explicit length check before zipping to preserve the previous safety.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Contributor
|
@podocarp was there any other reason why we were only supporting 3.12+? |
sohil-kshirsagar
approved these changes
Jan 16, 2026
There was a problem hiding this comment.
8 issues found across 28 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="drift/core/communication/communicator.py">
<violation number="1">
P2: Don’t gate cleanup on background thread liveness; always remove the pre-registered routing entries on failure to avoid stale events/data if the thread dies mid-request.</violation>
<violation number="2">
P2: Unblock the background reader before joining (e.g., socket.shutdown) so cleanup reliably stops the thread instead of timing out while it’s stuck in recv().</violation>
<violation number="3">
P2: Avoid `except Exception: continue` in the background read loop; break (or at least handle OSError explicitly) on non-timeout socket errors to prevent a busy loop and hidden failures.</violation>
</file>
<file name="drift/instrumentation/django/e2e-tests/src/test_requests.py">
<violation number="1">
P2: Importing the shared `make_request` helper fixes the timeout/logging duplication but it also hardcodes the base URL to `http://localhost:8000`, so this script no longer honors the `PORT` environment variable that the Django app (and docs) use for running tests on custom ports. Requests sent while the app listens on any non-default port will now connect to the wrong port and fail.</violation>
</file>
<file name="drift/instrumentation/psycopg/e2e-tests/src/app.py">
<violation number="1">
P1: `datetime.UTC` is unavailable on Python 3.9, so importing it breaks the module on the newly supported versions. Use `datetime.timezone.utc` (or alias it) instead.</violation>
</file>
<file name="drift/instrumentation/fastapi/e2e-tests/src/test_requests.py">
<violation number="1">
P2: Importing the shared `make_request` function drops support for the `PORT` environment variable; `test_utils.make_request` hard-codes `http://localhost:8000`, so the FastAPI e2e tests now fail whenever the server listens on a different port. Consider restoring the `PORT` override in the shared utility before using it here.</violation>
</file>
<file name="drift/instrumentation/e2e_common/base_runner.py">
<violation number="1">
P2: App stdout/stderr are redirected to DEVNULL, so the later `communicate()` call can never surface logs when the app fails to start, leaving no diagnostics.</violation>
</file>
<file name="drift/instrumentation/utils/psycopg_utils.py">
<violation number="1">
P2: If psycopg’s Range class isn’t available, the fallback returns the raw `__range__` payload so the lower/upper bounds stay serialized (e.g., ISO strings) instead of being converted back to datetimes/decimals. This breaks the “deserialize to original Python types” contract and yields inconsistent behavior between environments with and without psycopg installed.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Relaxes the Python version requirement from 3.12+ to 3.9+, significantly expanding the SDK's compatibility with existing Python projects.
Changes
requires-pythonfrom>=3.12to>=3.9typing_extensions>=4.4.0dependency for backported typing featuresdef f[T]()) with classicTypeVartyping.overridewithtyping_extensions.override(8 files)datetime.UTCwithdatetime.timezone.utc(Python 3.11+ feature)X | Yunion syntax withUnion[X, Y]in type aliaseszip(..., strict=True)with explicit length check in psycopg2 (Python 3.10+ feature)>=5.0to>=4.2from __future__ import annotationsto files usingX | Ysyntax in type hintsasyncio.TimeoutErrorhandling in tests for Python 3.9 compatibilityOther fixes:
DEVNULL, enabling diagnostic output when app fails to startWhy not 3.8 or earlier?
Core dependencies (
protobuf>=6.0,opentelemetry-api) require Python 3.9+, and built-in generic types (list[...],dict[...]) used throughout the codebase require 3.9+.Testing
ty check) passesruff check) passes