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

Implement deprecated field in json schema #9298

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

NeevCohen
Copy link
Contributor

@NeevCohen NeevCohen commented Apr 21, 2024

Change Summary

Reflect model depreciation in json schema

Related issue number

Related to #8922

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

Selected Reviewer: @Kludex

Copy link

codspeed-hq bot commented Apr 21, 2024

CodSpeed Performance Report

Merging #9298 will not alter performance

Comparing NeevCohen:feature/json-schema-deprecated (189a455) with main (2612947)

Summary

✅ 13 untouched benchmarks

@NeevCohen
Copy link
Contributor Author

Please review

Copy link
Member

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

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

@NeevCohen,

Nice work, as always! Just one minor change request, but looks great otherwise!

Comment on lines +1448 to +1450
if hasattr(cls, '__deprecated__'):
json_schema['deprecated'] = True

Copy link
Member

Choose a reason for hiding this comment

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

Just one thought here - we probably want to check if cls.__deprecated__ is True or a str, right? You can imagine a case where someone sets __deprecated__ to False on a model and this would lead to unexpected behavior. We maybe also want to check for None.

Copy link
Member

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

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

Oops, meant to 'request changes'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants