TkTech/pysimdjson

Instead of returning a KeyError at_pointer returns the value of the valid root

Closed this issue · 1 comments

Hello,

Step to reproduce:

>>> import simdjson
>>> parser = simdjson.Parser()
>>> t = '{"foo": "bar"}'
>>> d = parser.parse(t)      
>>> d.at_pointer("/foo")
'bar'
>>> d.at_pointer("/bar")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'No such key'
>>> d.at_pointer("/foo/foo")
'bar'

I expect that d.at_pointer("/foo/foo") returns a KeyError to be consistent with d.at_pointer("/bar").

This bug comes from simdjson version 5.0. On version 6.0, this bug has been fixed.

Best,
Hadrien

Sorry, I just noticed this has been fixed in 3.1.0. Thank you for your work.