Skip to content

ref(python): Remove runtime deprecation warnings - #838

Open
srothh wants to merge 2 commits into
mainfrom
srothh/remove-deprecation-warnings
Open

srothh wants to merge 2 commits into
mainfrom
srothh/remove-deprecation-warnings

Conversation

@srothh

@srothh srothh commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

Remove metaclass that emits runtime deprecation warnings when reading deprecated attributes. Deprecation warnings sent this way can be passed on to users through pytest. This behaviour is not desirable as attributes likely will not be fully removed from conventions.

PR Checklist

  • I have run yarn test and verified that the tests pass.
  • I have run yarn generate to generate and format code and docs.

@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-conventions Ready Ready Preview Nov 26, 2026 3:08pm UTC

Request Review

@github-actions

Copy link
Copy Markdown

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Attributes

  • Add schema for gen_ai.decide output by alexander-alderman-webb in #834
  • Add schema for gen_ai.decide input by alexander-alderman-webb in #833
  • Add schema for gen_ai.extract output by andreiborza and claude in #835
  • Add schema for gen_ai.extract input by andreiborza and claude in #832
  • Add db.response.returned_rows by BYK with sentry-junior in #826
  • Add http.response.delivery_type and deprecate http.response_delivery_type by msonnb with sentry-junior in #825
  • Add schema for chat-based gen_ai.input.messages by alexander-alderman-webb in #820

Bug Fixes 🐛

  • (docs) Stop long attribute names from overflowing on mobile by JPeer264 and Lms24 with sentry-junior in #821

Internal Changes 🔧

  • (python) Remove runtime deprecation warnings by srothh in #838

🤖 This preview updates automatically when you update the PR.

Comment thread scripts/generate_attributes.ts Resolved
@srothh
srothh marked this pull request as ready for review November 26, 2026 15:06

@sentrivana sentrivana 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.

I haven't looked at the surrounding code so maybe this is already there, but: even if we don't emit a deprecation warning, there should still be some way to tell via conventions that an attribute is deprecated so that packages using this can act on it if they choose to. Something like a set of the deprecated names, or a function that returns True/False based on whether the supplied attribute name is deprecated.

@Lms24 Lms24 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Two thoughts:

  • I don't think, sentry-conventions should be user-facing. For example, I wouldn't expose these constants via the python SDK (we don't do this in JS either). Talked a bit with @alexander-alderman-webb yesterday and I don't think we do this, but just wanted to mention anyway.
  • Let's make sure we're aligned with product. I imagine being aware of deprecations in this package is useful for the Sentry backend and Snuba (if it were JS I'd like to know about deprecations when linting my code for example).

Happy to leave everything up to you but let's make sure the solution works for SDKs and product

@srothh

srothh commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

I haven't looked at the surrounding code so maybe this is already there, but: even if we don't emit a deprecation warning, there should still be some way to tell via conventions that an attribute is deprecated so that packages using this can act on it if they choose to. Something like a set of the deprecated names, or a function that returns True/False based on whether the supplied attribute name is deprecated.

The JSON models hold deprecation info. The metadata written to Python contains classes for deprecation information which are filled from the models by the codegen and can be used to check for deprecation. Example in the generated attributes. This deprecation can be accessed over ATTRIBUTE_METADATA, which is exported by attributes.py .

This branch was successfully deployed

1 active deployment
Preview — f979bf38 Deployed Nov 26, 2026 by vercel[bot]
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.

4 participants