Skip to content

Conversation

@benieric
Copy link
Contributor

@benieric benieric commented Aug 30, 2024

Issue #, if available: #154

Description of changes:

  • Add extra="forbid" to ConfigDict used in pydantic BaseModel

    • Raise validation error if user inputs argument that does not exist in base model
  • Ran python src/sagemaker_core/tools/codegen.py since change was made in template. Other changes are from formatting

  • Files to look at with relevant changes. Others were from python src/sagemaker_core/tools/codegen.py making formatting changes:

    • src/sagemaker_core/main/resources.py - add extra="forbid"
    • src/sagemaker_core/main/shapes.py - add extra="forbid"
    • src/sagemaker_core/main/utils.py - filter fields not in the class when creating object in ResourceIterator
    • src/sagemaker_core/tools/templates.py
  • Do not merge - I think there is some discrepency with black where it is not consistent across environments

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@benieric benieric force-pushed the extra-forbid branch 2 times, most recently from ac24a39 to 984b78a Compare August 30, 2024 22:03
@benieric benieric changed the title Add forbid extra for pydantic BaseModel Add forbid extra for pydantic BaseModel [DO-NOT-MERGE] Aug 30, 2024
@benieric benieric force-pushed the extra-forbid branch 2 times, most recently from b9d2ad3 to 9263813 Compare August 30, 2024 23:17
@benieric benieric changed the title Add forbid extra for pydantic BaseModel [DO-NOT-MERGE] Add forbid extra for pydantic BaseModel Aug 30, 2024
@benieric benieric enabled auto-merge (squash) September 3, 2024 23:20
@benieric benieric disabled auto-merge September 3, 2024 23:21
@benieric benieric merged commit 025719f into aws:main Sep 3, 2024
@benieric benieric deleted the extra-forbid branch September 3, 2024 23:21
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