Skip to content

feat(types): Export SpanJSON type - #7331

Open
ericapisani wants to merge 1 commit into
masterfrom
py-2759-export-span-json-type
Open

feat(types): Export SpanJSON type#7331
ericapisani wants to merge 1 commit into
masterfrom
py-2759-export-span-json-type

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Fixes PY-2759
Fixes #7330

@ericapisani
ericapisani requested a review from a team as a code owner September 1, 2026 18:36
@linear-code

linear-code Bot commented Sep 1, 2026

Copy link
Copy Markdown

PY-2759

ericapisani added a commit to getsentry/testing-sentry-python that referenced this pull request Sep 1, 2026
Uses the SpanJSON type now exported from sentry_sdk.types by
getsentry/sentry-python#7331, replacing the dict[str, Any] placeholder
and the comment explaining why no public span type was available.

Verified with mypy against the local sentry-python checkout: SpanJSON
resolves to the real TypedDict (not Any) and invalid keys are rejected.
ericapisani added a commit to getsentry/testing-sentry-python that referenced this pull request Sep 1, 2026
* feat(test-callback-typing): Enable span streaming

Turn on top-level trace_lifecycle="stream" and swap the
before_send_transaction callback for before_send_span, matching the
new streamed-span callback API. Bump the sentry-sdk dependency floor
to >=2.68.1, the version that introduced trace_lifecycle.

* ref(test-callback-typing): Type before_send_span with public SpanJSON

Uses the SpanJSON type now exported from sentry_sdk.types by
getsentry/sentry-python#7331, replacing the dict[str, Any] placeholder
and the comment explaining why no public span type was available.

Verified with mypy against the local sentry-python checkout: SpanJSON
resolves to the real TypedDict (not Any) and invalid keys are rejected.
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

125598 passed | ❌ 1 failed | ⏭️ 6763 skipped | Total: 132362 | Pass Rate: 94.89% | Execution Time: 455m 28s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +692
Passed Tests 📈 +695
Failed Tests 📉 -3
Skipped Tests

➕ New Tests (1)

View new tests
  • test_cache_spans_templatetag[True]
    • File: tests.integrations.django.test_cache_module
    • Status: ❌ Failing

➖ Removed Tests (4)

View removed tests
  • test_cache_spans_decorator[True]
    • File: tests.integrations.django.test_cache_module
  • test_continuous_profiler_auto_start_and_stop_sampled[experiment-thread]
    • File: tests.profiler.test_continuous_profiler
  • test_continuous_profiler_auto_start_and_stop_sampled[non-experiment-gevent]
    • File: tests.profiler.test_continuous_profiler
  • test_continuous_profiler_auto_start_and_stop_sampled_span_streaming[experiment-thread]
    • File: tests.profiler.test_continuous_profiler

❌ Failed Tests

test_cache_spans_templatetag[True]

File: tests.integrations.django.test_cache_module
Suite: py3.12-django-v6.1
Error: tests/integrations/django/test_cache_module.py:486: in test_cache_spans_templatetag assert not spans[0]["attributes"]["cache.hit"] E assert not True

Stack Trace
tests/integrations/django/test_cache_module.py:486: in test_cache_spans_templatetag
    assert not spans[0]["attributes"]["cache.hit"]
E   assert not True

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

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    90.27%    90.27%        —%
==========================================
  Files          193       193         —
  Lines        25649     25650        +1
  Branches      9454      9454         —
==========================================
+ Hits         23153     23154        +1
- Misses        2496      2496         —
- Partials      1443      1443         —

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.

Export SpanJSON type

1 participant