Data analyzer execution error
Hello - I am completely stumped by the below error. Help would be much appreciated!
-
Hi Rodi,
The issue is the data contains a 'date' type field and one or more values are Null (i.e. None in Python). This is a known issue with the Data Analyzer node that only occurs when the input field type is 'date' - i.e. it does not happen when the data type is a string.
The simplest way around this, assuming you are just using the Data Analyzer node to change the data types rather than using the node's histogram functionality, is to use the Data Converter node rather than the Data Analyzer node. The Data Converter node can be found in the Aggregation and Transformation category of the node library.
If you really need to use the Data Analyzer for some reason then you could modify the input data by inserting a Transform node and configuring it to change the affected field to an empty string so that the Data Analyzer can handle the missing values. The following example assumes the affected field name is "dt":
##ConfigureFields property
#Configure all fields from input 'in1' to be mapped
#to the corresponding fields on the output 'out1'
outputs[0] += inputs[0]## Remove the input date type field
outputs[0] -= inputs[0]['dt']## Recreate the field as a string type field
outputs[0]['dt'] = str##ProcessRecords
#Copy all fields from input 'in1' to the corresponding output fields
#in output 'out1'. Copies the values of the fields that have been setup
#in the mapping defined in the ConfigureFields property
outputs[0] += inputs[0]## Output the date type field as a string and replace Null with an empty string
outputs[0]['dt'] = str(inputs[0]['dt']).replace('Null','')
Please sign in to leave a comment.
Comments
4 comments