Skip to content

Add ExperimentalWarning class and indicate reactions and targeted messages as preview#306

Open
corinagum wants to merge 6 commits intomainfrom
cg/experimental-marking
Open

Add ExperimentalWarning class and indicate reactions and targeted messages as preview#306
corinagum wants to merge 6 commits intomainfrom
cg/experimental-marking

Conversation

@corinagum
Copy link
Contributor

  • ExperimentWarning is a subclass to FutureWarning so users supress preview API warnings if desired.
  • @experimental("TEAMS0001") decorator - emits warnings when applied to a class or function
  • Mark reactions and targeted messages as preview

Note that suppression is not granular - while C# differentiates between different diagnostics, the ignore below will suppres all preview warnings.

To suppress the warnings:

import warnings
from microsoft_teams.common.experimental import ExperimentalWarning

warnings.filterwarnings("ignore", category=ExperimentalWarning)

Copilot AI review requested due to automatic review settings March 6, 2026 22:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.py module with ExperimentalWarning (subclass of FutureWarning) and the @experimental(diagnostic) decorator for both classes and async/sync functions.
  • ReactionClient decorated with @experimental("TEAMS0001") and its docstring updated.
  • ConversationActivityClient's three targeted methods decorated with @experimental("TEAMS0002"); ActivityInput.with_recipient and is_targeted field 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

@corinagum corinagum force-pushed the cg/experimental-marking branch from bc621d4 to c8f9d6a Compare March 9, 2026 20:17
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.

2 participants