-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-export Event
in types.py
#2829
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Fixed your comment, @antonpirker. Also, I know we had discussed maybe changing our internal imports of Perhaps, it would make sense just to change the import in |
Its not as important right now do update our internal imports. We can do this in a later PR, with this PR we have everything in place that the users care about. Baby steps to success :-) |
@antonpirker, yes of course, I was planning to make any import changes within a separate PR :) |
What version is it available in? |
@mdczaplicki This PR is not released yet. It should be included in our next release! |
I see. When do you plan to release? |
@mdczaplicki, there is no date set yet for the next release. However, we will probably release a new version including these changes sometime this week. |
Would you say that 1.42 should be yanked? If we use |
@mdczaplicki Apologies for the inconvenience. We plan to release a new version including these changes later today. However, we will not yank 1.42 because the code itself remains backwards compatible. If you are encountering problems with the new type hinting, we would recommend updating your |
Shouldn't you add the following to the file also? Otherwise non-typechecking environment can't do the import else:
Event = dict[str, Any]
Hint = ... and would instead need to do it ourselves # my_project/module/types.py
if TYPE_CHECKING:
from sentry_sdk.types import Event
else:
Event = dict[str, Any] |
End-users may need to use the
Event
type for their type hinting to work following theEvent
type changes. However, we defineEvent
in a private modulesentry_sdk._types
, which provides no stability guarantees.Therefore, this PR creates a new public module
sentry_sdk.types
, where we re-export theEvent
type, and explicitly make it available as public API viasentry_sdk.types.Event
. The newsentry_sdk.types
module includes a docstring to inform users that we reserve the right to modify types in minor releases, since we consider types to be a form of documentation (they are not enforced by the Python language), but that we guarantee that we will only remove type definitions in a major release.