Title: expose Event type in package api · Issue #4122 · getsentry/sentry-python · GitHub
Open Graph Title: expose Event type in package api · Issue #4122 · getsentry/sentry-python
X Title: expose Event type in package api · Issue #4122 · getsentry/sentry-python
Description: Problem Statement Was wondering by the Event type was hidden in a private module _types, I am writing my before_send function and because I am a good pythonista I wanted to type it :) The type was added in #2753 but maybe it didn't occur...
Open Graph Description: Problem Statement Was wondering by the Event type was hidden in a private module _types, I am writing my before_send function and because I am a good pythonista I wanted to type it :) The type was ...
X Description: Problem Statement Was wondering by the Event type was hidden in a private module _types, I am writing my before_send function and because I am a good pythonista I wanted to type it :) The type was ...
Opengraph URL: https://github.com/getsentry/sentry-python/issues/4122
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"expose Event type in package api","articleBody":"### Problem Statement\n\nWas wondering by the `Event` type was hidden in a private module `_types`, I am writing my `before_send` function and because I am a good pythonista I wanted to type it :)\n\nThe type was added in #2753 but maybe it didn't occur to them to add it then?\n\nThe same would probably apply to a lot of other types the user might need (`hint` etc...)\n\nHere is how I currently do it, which is fine, but it doesn't encourage typing\n\n```python\nimport sentry_sdk\nfrom sentry_sdk._types import Event, Hint\n\n\ndef before_send(event: Event, hint: Hint) -> Event:\n # do some stuff\n ...\n return event\n\n\nsentry_sdk.init(\n dsn=\"***\",\n before_send=before_send\n)\n```\n\n### Solution Brainstorm\n\nAdd to init? change submodule to public, `typing` or `types`?","author":{"url":"https://github.com/fraser-langton","@type":"Person","name":"fraser-langton"},"datePublished":"2025-03-06T22:55:30Z","url":"https://github.com/getsentry/sentry-python/issues/4122"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3afba424-4e54-6429-5894-dfeac903078a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DEEE:3BD860:39E7B3:4D7210:6B008A93 |
| html-safe-nonce | 23533b92e4ac155017d5ac8af74be9779324917d25d7ee8d945afa13f5a0138a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERUVFOjNCRDg2MDozOUU3QjM6NEQ3MjEwOjZCMDA4QTkzIiwidmlzaXRvcl9pZCI6IjczMTU0MTU0ODY5MzI0ODY4MDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | fedb775439a92881fbc5b1a0587466fecc37e87dd9f9709d6a862746fcdb7e16 |
| hovercard-subject-tag | issue:2901602274 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-python/4122/issue_layout |
| twitter:image | https://opengraph.githubassets.com/30a465e38d0a4e94fbe5c81502cc9d9e6a270f5ff565b5476b5b098ed01e7ae9/getsentry/sentry-python/issues/4122 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/30a465e38d0a4e94fbe5c81502cc9d9e6a270f5ff565b5476b5b098ed01e7ae9/getsentry/sentry-python/issues/4122 |
| og:image:alt | Problem Statement Was wondering by the Event type was hidden in a private module _types, I am writing my before_send function and because I am a good pythonista I wanted to type it :) The type was ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fraser-langton |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4d3d8e50f02c1d7bf86d5acfa1d3bfe9366abd6528a6b429eb07a168429d2b61 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-python git https://github.com/getsentry/sentry-python.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 137814779 |
| octolytics-dimension-repository_nwo | getsentry/sentry-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 137814779 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | db758f8e02b8257935fb03edf81a3e76eb3abd11 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width