Return integer or string instead of None from a JMESPath query
Return integer or string instead of None from a JMESPath query Question: Is there a way to return an integer or a string instead of None? I know that I can do an additional check like: item = {"SX": {"BX": 1}} value = jmespath.search("SX.BX", item) if jmespath.search("SX.BX", item) else 0 but the condition is very …