move the save to dataset to telemetry

This commit is contained in:
Dinesh Yeduguru 2024-12-05 13:36:46 -08:00
parent 4c78432bc8
commit f5d427c178
9 changed files with 79 additions and 64 deletions

View file

@ -349,11 +349,14 @@ def check_protocol_compliance(obj: Any, protocol: Any) -> None:
method_owner = next(
(cls for cls in mro if name in cls.__dict__), None
)
if (
method_owner is None
or method_owner.__name__ == protocol.__name__
):
proto_method = getattr(protocol, name)
if method_owner is None:
missing_methods.append((name, "not_actually_implemented"))
elif method_owner.__name__ == protocol.__name__:
# Check if it's just a stub (...) or has real implementation
proto_source = inspect.getsource(proto_method)
if "..." in proto_source:
missing_methods.append((name, "not_actually_implemented"))
if missing_methods:
raise ValueError(