Skip to content
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

Python: fix: Preserve class type in experimental_class decorator to avoid type inference issues #6709

Merged
merged 2 commits into from
Jun 14, 2024

Conversation

miladh
Copy link
Contributor

@miladh miladh commented Jun 14, 2024

Motivation and Context

Closes #6707

Description

  • Introduce TypeVar T bounded to type to ensure the decorator maintains the class type.
  • Modify the experimental_class decorator to use the bounded TypeVar for accurate type hinting.

Contribution Checklist

…ype inference issues

- Introduce `TypeVar` `T` bounded to `type` to ensure the decorator maintains the class type.
- Modify the `experimental_class` decorator to use the bounded `TypeVar` for accurate type hinting.
@markwallace-microsoft markwallace-microsoft added the python Pull requests for the Python Semantic Kernel label Jun 14, 2024
@github-actions github-actions bot changed the title fix: Preserve class type in experimental_class decorator to avoid type inference issues Python: fix: Preserve class type in experimental_class decorator to avoid type inference issues Jun 14, 2024
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Jun 14, 2024

Py3.10 Test Coverage

Python 3.10 Test Coverage Report •
FileStmtsMissCoverMissing
TOTAL636371889% 
report-only-changed-files is enabled. No files were changed during this commit :)

Python 3.10 Unit Test Overview

Tests Skipped Failures Errors Time
1511 1 💤 0 ❌ 0 🔥 18.802s ⏱️

@miladh miladh marked this pull request as ready for review June 14, 2024 16:45
@miladh miladh requested a review from a team as a code owner June 14, 2024 16:45
Copy link
Contributor

@moonbox3 moonbox3 left a comment

Choose a reason for hiding this comment

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

Thanks for doing this!

@moonbox3 moonbox3 enabled auto-merge June 14, 2024 16:47
@moonbox3 moonbox3 added this pull request to the merge queue Jun 14, 2024
Merged via the queue into microsoft:main with commit a9d361a Jun 14, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests for the Python Semantic Kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python: experimental_class decorator (new in semantic kernel 1.0.x) is causing typing errors (?)
4 participants