aws / sagemaker-core

Apache License 2.0
5 stars 3 forks source link

Resolve 'field x has conflict with protected namespace model_' Pydantic warnings #12

Closed benieric closed 4 months ago

benieric commented 4 months ago

Issue #, if available:

Description of changes:

This warning is raised when a pydantic model contains an attribute that is prefixed with "model_". Implementing workaround to suppress such warnings as they are noisy. Pydantic itself suggest You may be able to resolve this warning by settingmodel_config['protected_namespaces'] = ()` to resolve.

From pydantic docs: "While Pydantic will only emit a warning when an item is in a protected namespace but does not actually have a collision, an error is raised if there is an actual collision with an existing attribute:"

Reference:

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