Add ExperimentalWarning class and indicate reactions and targeted messages as preview#306
Open
Add ExperimentalWarning class and indicate reactions and targeted messages as preview#306
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces an ExperimentalWarning class and @experimental decorator to the microsoft_teams.common package, providing a mechanism to mark preview APIs with runtime warnings. It then applies these markers to two preview features: reaction support (ReactionClient) and targeted messages (create_targeted, update_targeted, delete_targeted, and with_recipient's is_targeted parameter).
Changes:
- New
experimental.pymodule withExperimentalWarning(subclass ofFutureWarning) and the@experimental(diagnostic)decorator for both classes and async/sync functions. ReactionClientdecorated with@experimental("TEAMS0001")and its docstring updated.ConversationActivityClient's three targeted methods decorated with@experimental("TEAMS0002");ActivityInput.with_recipientandis_targetedfield updated to emit the same warning.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
packages/common/src/microsoft_teams/common/experimental.py |
New file: defines ExperimentalWarning and @experimental decorator |
packages/common/src/microsoft_teams/common/__init__.py |
Exports ExperimentalWarning and experimental from the package |
packages/api/src/microsoft_teams/api/clients/reaction/client.py |
Applies @experimental("TEAMS0001") to ReactionClient |
packages/api/src/microsoft_teams/api/clients/conversation/activity.py |
Applies @experimental("TEAMS0002") to targeted activity methods |
packages/api/src/microsoft_teams/api/models/activity.py |
Adds ExperimentalWarning emission to with_recipient when is_targeted is set; updates docstrings |
bc621d4 to
c8f9d6a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ExperimentWarningis a subclass toFutureWarningso users supress preview API warnings if desired.Note that suppression is not granular - while C# differentiates between different diagnostics, the ignore below will suppres all preview warnings.
To suppress the warnings: