Skip to content

feat(typesafe): Handle inline images - #8164

Merged
alexander-alderman-webb merged 1 commit into
masterfrom
webb/typesafe/widen-type
Nov 3, 2026
Merged

alexander-alderman-webb merged 1 commit into
masterfrom
webb/typesafe/widen-type

Conversation

@alexander-alderman-webb

@alexander-alderman-webb alexander-alderman-webb commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Content was widened to a type that's JSON compatible or contains unserializable Image instances.
See typesafe-ai/typesafe-sdk-python@f36e685.

The change is to add a

def _json_default(value: object) -> str:
    """
    Render an inline typesafe `Image` as its reference, mirroring the SDK's handling.
    """
    if isinstance(value, Image):
        return str(value)

    return "<unserializable>"

and pass it as json.dumps(..., default=_json_default).

Issues

Closes #8167

Reminders

@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/typesafe/widen-type branch 4 times, most recently from 0f50489 to 3580bfd Compare October 30, 2026 10:08
@alexander-alderman-webb
alexander-alderman-webb marked this pull request as ready for review October 30, 2026 10:19
@alexander-alderman-webb
alexander-alderman-webb requested a review from a team as a code owner October 30, 2026 10:19
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ 2588 passed | ⏭️ 30 skipped | Total: 2618 | Pass Rate: 98.85% | Execution Time: 15m 15s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -141000
Passed Tests 📉 -133573
Failed Tests 📉 -1
Skipped Tests 📉 -7426

➖ Removed Tests (1)

View removed tests
  • test_db_transaction_spans_disabled_no_autocommit[True]
    • File: tests.integrations.django.test_db_transactions

All tests are passing successfully.

❌ Patch coverage is 0.00% (0 of 12 changed executable lines covered; target 80%).
Project statement coverage is 32.48%.

Changed files with executable lines (1)
File Patch coverage Changed executable lines
sentry_sdk/integrations/typesafe.py 0.00% 0/12 covered; missed: 69, 84, 85, 86, 87, 102, 106, 107, 109, 185, 291, 405

Generated by Coverage Action

@alexander-alderman-webb
alexander-alderman-webb merged commit ce9adf5 into master Nov 3, 2026
322 of 326 checks passed
@alexander-alderman-webb
alexander-alderman-webb deleted the webb/typesafe/widen-type branch November 3, 2026 15:27
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.

Handle TypeSafe images

2 participants