Skip to content

Conversation

@moonbox3
Copy link
Collaborator

@moonbox3 moonbox3 commented Jul 8, 2024

Motivation and Context

We have mypy enabled on parts of the code base, but not all. The goal is to enable it across the entire SK python code. As part of this, we've broken up the work to tackle different sections. Additionally, we're working to improve the code coverage for these sections of code.

Description

This PR:

  • turns on mypy for the openapi connector (plugin). Code adjustments were made per mypy, with the exclusion of two places that contain a type: ignore as the type was already valid, but mypy still complained.
  • adds more unit test coverage for the OpenAPI models and classes. All OpenAPI classes are now >95% covered.
  • closes Python: CQ Spike: OpenAPI Plugin #7135

Contribution Checklist

@moonbox3 moonbox3 requested a review from a team as a code owner July 8, 2024 17:28
@markwallace-microsoft markwallace-microsoft added the python Pull requests for the Python Semantic Kernel label Jul 8, 2024
@moonbox3 moonbox3 self-assigned this Jul 8, 2024
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Jul 8, 2024

Py3.10 Test Coverage

Python 3.10 Test Coverage Report •
FileStmtsMissCoverMissing
semantic_kernel/connectors/openapi_plugin
   openapi_manager.py61395%51, 115–116
   openapi_parser.py88199%127
   openapi_runner.py105298%181–182
semantic_kernel/connectors/openapi_plugin/models
   rest_api_operation.py129199%240
TOTAL666762391% 

Python 3.10 Unit Test Overview

Tests Skipped Failures Errors Time
1644 1 💤 0 ❌ 0 🔥 19.793s ⏱️

Copy link
Member

@eavanvalkenburg eavanvalkenburg left a comment

Choose a reason for hiding this comment

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

Small question, otherwise looks great!

Copy link
Member

@eavanvalkenburg eavanvalkenburg left a comment

Choose a reason for hiding this comment

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

LGTM

@moonbox3 moonbox3 added this pull request to the merge queue Jul 8, 2024
Merged via the queue into microsoft:main with commit 44f5db1 Jul 8, 2024
@moonbox3 moonbox3 deleted the openapi_code_quality branch July 8, 2024 20:59
LudoCorporateShark pushed a commit to LudoCorporateShark/semantic-kernel that referenced this pull request Aug 25, 2024
…crosoft#7153)

### Motivation and Context

We have mypy enabled on parts of the code base, but not all. The goal is
to enable it across the entire SK python code. As part of this, we've
broken up the work to tackle different sections. Additionally, we're
working to improve the code coverage for these sections of code.

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

### Description

This PR:
- turns on mypy for the openapi connector (plugin). Code adjustments
were made per mypy, with the exclusion of two places that contain a
`type: ignore` as the type was already valid, but mypy still complained.
- adds more unit test coverage for the OpenAPI models and classes. All
OpenAPI classes are now >95% covered.
- closes microsoft#7135 

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [X] The code builds clean without any errors or warnings
- [X] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
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

Archived in project

Development

Successfully merging this pull request may close these issues.

Python: CQ Spike: OpenAPI Plugin

6 participants