TkTech / pysimdjson

Python bindings for the simdjson project.
https://pysimdjson.tkte.ch
Other
643 stars 54 forks source link

Return a default value from at_pointer when the key doesn't exist #105

Closed ELind77 closed 1 year ago

ELind77 commented 1 year ago

I'd like to request a feature to return a default value from at_pointer when the path doesn't exist rather than throwing a key error. This is especially important when parsing data with a mixed schema--e.g. application log/data that have changed schema over time.

Not throwing and catching the error could save significant time as Python error handling isn't especially performant and it would give users more flexibility to decide how to handle missing keys/values.

TkTech commented 1 year ago

Completed in #110.