When making a call to a State Machine with float('nan') in the payload, the result hints to enable JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS because of the Non-standard token 'NaN' .
import boto3
import json
client = boto3.client('stepfunctions', endpoint_url=endpoint_url)
client.start_sync_execution(stateMachineArn='state_machine_arn',
name='new-execution',
input=json.dumps({'foo': float('nan')})
(truncating)
InvalidExecutionInput Traceback (most recent call last)
...
~/opt/miniconda3/envs/pandars38/lib/python3.8/site-packages/botocore/client.py in _make_api_call(self, operation_name, api_params)
674 error_code = parsed_response.get("Error", {}).get("Code")
675 error_class = self.exceptions.from_code(error_code)
--> 676 raise error_class(parsed_response, operation_name)
677 else:
678 return parsed_response
InvalidExecutionInput: An error occurred (InvalidExecutionInput) when calling the StartSyncExecution operation: Invalid State Machine Execution Input: 'Non-standard token 'NaN': enable JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS to allow'
(wrapping)
InvalidExecutionInput:
An error occurred (InvalidExecutionInput) when calling the StartSyncExecution operation:
Invalid State Machine Execution Input:
'Non-standard token 'NaN': enable JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS to allow'
The same exception happens with the numpy np.nan as well.