deepdiff icon indicating copy to clipboard operation
deepdiff copied to clipboard

why exclude_regex_paths dont work with ignore_order

Open alisherdev98 opened this issue 1 year ago • 1 comments

class Image(BaseModel):
    size: SizeFormat
    extension: ImageFormat
    data: bytes

Image object contains the data field, which is a byte string representing the image. When comparing Image lists, an error occurs:

{UnicodeDecodeError}UnicodeDecodeError('utf-8', b'RIFF\x84-\x03\x00WEBPVP8 x-\x03\x00P\xe1\n\x9d\x01*\x80\x078\x04>m2\x95H\xa4"\xa4\xa6$\x93\xca\x...x03\x00P\n\x01*\x078...'. Please either pass ignore_encoding_errors=True or pass the encoding via encodings=['utf-8', '...'].")

I'm trying to calculate the differences in the following way: DeepDiff([image1], [image2], ignore_order=True, exclude_regex_paths=r'\[\d+\].data') But the error does not disappear...

alisherdev98 avatar Mar 01 '24 08:03 alisherdev98

@alisherdev98 Thanks for reporting the bug. Can you give me reproducible code please?

seperman avatar Apr 05 '24 07:04 seperman