This documentation was generated with AI assistance and is still being audited. Some, or potentially a lot, of this information may be inaccurate. Learn more.
@register_function(name="lens_jq",component_of="lens")deflens_jq(input_data:Any,query:str,*,lens:LensCapability)->Any:"""Applies a jq query and returns a native Python object."""ifnotlens.is_enabled:raiseFunctionError("The 'lens' capability is disabled in the provider configuration.")ifnotisinstance(query,str)ornotquery:raiseFunctionError("The 'query' argument must be a non-empty string.")# Ensure input_data is converted to native Python before passing to JQnative_input_data=cty_to_native(input_data)ifisinstance(input_data,CtyValue)elseinput_datatry:result_cty=lens.jq(query,native_input_data)result=cty_to_native(result_cty)returnresultexceptException:raise