Skip to content

fix(asyncpg): Add db.query.text to streamed query spans#6633

Merged
ericapisani merged 2 commits into
masterfrom
py-2544-add-db-attr-to-asyncpg
Jun 23, 2026
Merged

fix(asyncpg): Add db.query.text to streamed query spans#6633
ericapisani merged 2 commits into
masterfrom
py-2544-add-db-attr-to-asyncpg

Conversation

@ericapisani

@ericapisani ericapisani commented Jun 23, 2026

Copy link
Copy Markdown
Member

Fixes PY-2546
Fixes #6632

@linear-code

linear-code Bot commented Jun 23, 2026

Copy link
Copy Markdown

PY-2544

PY-2546

@ericapisani ericapisani marked this pull request as ready for review June 23, 2026 14:39
@ericapisani ericapisani requested a review from a team as a code owner June 23, 2026 14:39

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 39b7f96. Configure here.

span,
span_streaming,
"test_cursor_fetch_methods_create_spans",
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Query source checked once only

Low Severity

Refactoring test_cursor_fetch_methods_create_spans moved _assert_query_source out of the loop over both fetch-row spans, so it runs once on the last span only. The prior version asserted query-source metadata on each of the two fetchrow spans; regressions on the first span would no longer fail the test.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 39b7f96. Configure here.

Comment thread sentry_sdk/tracing_utils.py Outdated
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

91401 passed | ⏭️ 6136 skipped | Total: 97537 | Pass Rate: 93.71% | Execution Time: 327m 45s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +13
Passed Tests 📈 +13
Failed Tests
Skipped Tests

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2407 uncovered lines.
✅ Project coverage is 89.87%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
sentry_sdk/tracing_utils.py 100.00% ⚠️ 1 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    89.86%    89.87%    +0.01%
==========================================
  Files          192       192         —
  Lines        23758     23763        +5
  Branches      8204      8206        +2
==========================================
+ Hits         21349     21356        +7
- Misses        2409      2407        -2
- Partials      1344      1343        -1

Generated by Codecov Action

@alexander-alderman-webb alexander-alderman-webb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 🚀

@ericapisani ericapisani merged commit c04b944 into master Jun 23, 2026
142 of 144 checks passed
@ericapisani ericapisani deleted the py-2544-add-db-attr-to-asyncpg branch June 23, 2026 16:33
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.

Set db.query.text attribute in asyncpg

2 participants