Skip to content

Conversation

@tkersey
Copy link
Contributor

@tkersey tkersey commented Mar 7, 2025

No description provided.

@tkersey tkersey requested a review from Copilot March 7, 2025 22:15
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.

PR Overview

This PR introduces a new JSON schema validator example for testing responses in the team recommender module. It adds a new test file for schema validation and updates the workflow configuration to run the new example tests.

  • Introduces tests for validating JSON schema and response integrity.
  • Updates the workflow to run tests matching the new example pattern.

Reviewed Changes

File Description
examples/team_recommender/tests/example_7_schema_validators/test_response_has_valid_schema.py Added test functions to validate JSON responses and developer selections.
.github/workflows/cat-test-examples.yml Adjusted test run command to target the new example test files.

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

examples/team_recommender/tests/example_7_schema_validators/test_response_has_valid_schema.py:24

  • The 'response' parameter is annotated as a string, yet the function is sometimes called with parsed JSON objects. Consider updating the type annotation to reflect the actual data type or ensuring the input is consistently a string.
def response_matches_json_schema(response: str, schema: any) -> bool:

failure_count = sum(not result for result in results)
total_count = len(results)
failure_rate = float(failure_count) / float(total_count)
print(1.0 - failure_rate)
Copy link

Copilot AI Mar 7, 2025

Choose a reason for hiding this comment

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

Using print for debugging in production test code may not be ideal; consider using a proper logging framework or removing the debug statement.

Suggested change
print(1.0 - failure_rate)
logging.info(1.0 - failure_rate)

Copilot uses AI. Check for mistakes.
@paulz paulz merged commit 80f88ee into main Mar 7, 2025
1 of 2 checks passed
@paulz paulz deleted the schema-validators branch March 7, 2025 22:24
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.

3 participants