-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
Description
if cls.storage_type == ONE_OBJECT_PER_TABLE:
check_has_standard_method(cls, 'to_table')
check_has_class_method(cls, 'from_table')
elif cls.storage_type == ONE_OBJECT_MULTIPLE_TABLES:
check_has_standard_method(cls, 'to_tables')
check_has_class_method(cls, 'from_tables')
elif cls.storage_type == MULTIPLE_OBJECTS_PER_TABLE:
check_has_class_method(cls, 'to_table')
check_has_class_method(cls, 'from_table')
else:
raise RuntimeError(f"Subclasses of BaseIO must have a class variable storage_type set to one of "
f"{ONE_OBJECT_PER_TABLE}, {MULTIPLE_OBJECTS_PER_TABLE}, or {ONE_OBJECT_MULTIPLE_TABLES}, "
Currently baseio has a series of checks to ensure that the classes are properly created.
Could we look into enforcing this with an abstract base class?