Environment
- Python version: 3.12
- jdiff version: 1.0.2
Expected Behavior
I can use diff's extract_data_from_json to extract integer's or floats
Observed Behavior
TypeError: 'float' object is not iterable.
Steps to Reproduce
Provide the jmespath get_facts.uptime when parsing the data from the Napalm get_facts command.
The issue is that the return from jmespath.search("get_facts.uptime", data) is 5343600.0, which is not a list. This bug likely has not come up since lists, dictionaries and strings are all scalers, so iterating on them will succeed.
OR
a simpler version is:
extract_data_from_json({"x": 5}, "x") raises TypeError: 'int' object is not iterable
|
if any(isinstance(i, list) for i in values): |
Environment
Expected Behavior
I can use diff's extract_data_from_json to extract integer's or floats
Observed Behavior
TypeError: 'float' object is not iterable.
Steps to Reproduce
Provide the jmespath get_facts.uptime when parsing the data from the Napalm get_facts command.
The issue is that the return from jmespath.search("get_facts.uptime", data) is 5343600.0, which is not a list. This bug likely has not come up since lists, dictionaries and strings are all scalers, so iterating on them will succeed.
OR
a simpler version is:
extract_data_from_json({"x": 5}, "x")raisesTypeError: 'int' object is not iterablejdiff/jdiff/extract_data.py
Line 65 in f91f4f9