Skip to content

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

@VigneshVSV

Description

@VigneshVSV

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

Metadata

Metadata

Assignees

Labels

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions