Skip to content

feat(asyncpg): Add query source to execute, executemany, and cursor#6242

Open
ericapisani wants to merge 3 commits intopy-2305-migrate-asyncpgfrom
py-2305-add-query-source-to-methods-that-were-missing-it
Open

feat(asyncpg): Add query source to execute, executemany, and cursor#6242
ericapisani wants to merge 3 commits intopy-2305-migrate-asyncpgfrom
py-2305-add-query-source-to-methods-that-were-missing-it

Conversation

@ericapisani
Copy link
Copy Markdown
Member

@ericapisani ericapisani commented May 8, 2026

Summary

  • Add add_query_source() calls to _wrap_connection_method and _wrap_cursor_creation, which cover execute(), executemany(), prepare(), and cursor(). Previously only fetch() had query source tracking via the patched _wrap_execute method.
  • Handle StreamedSpan vs regular span cases separately (StreamedSpan needs the call inside the context manager).

Add add_query_source() calls to execute(), executemany(), and cursor() methods. Previously only fetch() had query source tracking. Handle StreamedSpan and regular span cases separately since StreamedSpan requires the call while still inside the context manager.

Add comprehensive test coverage for query source tracking across all wrapped methods.
@ericapisani ericapisani requested a review from a team as a code owner May 8, 2026 17:12
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 8, 2026

PY-2305

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Codecov Results 📊

13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 8.90s

All tests are passing successfully.

❌ Patch coverage is 0.00%. Project has 15167 uncovered lines.

Files with missing lines (1)
File Patch % Lines
asyncpg.py 10.00% ⚠️ 135 Missing

Generated by Codecov Action

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.

1 participant