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

Refactor Thing metaclass validation to something different from TypedKeyMappingsConstrainedDict in __prepare__ #22

Open
3 tasks
VigneshVSV opened this issue Jul 27, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@VigneshVSV
Copy link
Owner

VigneshVSV commented Jul 27, 2024

Dreadful name for dictionary based validation apart (TypedKeyMappingsConstrainedDict), its not really robust either.

The idea is to support validation of class level attributes specified by the inherited Thing class (which is also growing). For example, logger_remote_access, use_default_db, we want to later add stuff like allow_bypass_schema_validation, allow_unauthorized_access

Possible steps

  • check if pydantic can solve this problem better, if yes integrate it
  • If not, rewrite __new__ to perform manual but step-by-step validation in ThingMeta (thing.py), which may be verbose but can at least be made robust
  • Test with test_thing_init.py test script
@VigneshVSV VigneshVSV added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant