Adding util to help with overriding the ._members method (useful for upserts where we iterate over the member attributes)
Adding Encode/Decode exceptions
Adding fix for auto filter fields (providing same interface as normal instrumented attributes)
From this:
def encode(self, value: list[T]) -> str:
> return json.dumps([self.element_encoder.encode(element) for element in value])
E TypeError: 'NoneType' object is not iterable
To this:
self = <microcosm_postgres.encryption.v2.encoders.ArrayEncoder object at 0x111830d60>, value = None
def wrapped(self, value):
try:
return func(self, value)
except Exception as e:
> raise Encoder.EncodeException(f"Failed to encode value {value}") from e
E microcosm_postgres.encryption.v2.encoders.Encoder.EncodeException: Failed to encode value None
._members
method (useful for upserts where we iterate over the member attributes)From this:
To this: