Description
When using a custom SOQL query to retrieve results, columns in SOQL results that are represented using a float value are incorrectly converted to integers if the columns are in the numeric field mappings when converting generated log entries to events when sending data to New Relic as events.
Steps to Reproduce
- Create a custom query that selects a column that is returned as a float value
- Add the column to the numeric field mappings
- Set configuration to generate events
- Execute the integration
Expected Behavior
The event attribute value corresponding to the float field in SOQL results for the custom query are float values.
Actual Behavior
The event attribute value corresponding to the float field in SOQL results for the custom query are integer values, not float values.
Additional context
This is due to the fact that we are assuming that the input value to maybe_convert_str_to_num
is a string when we are converting columns to numeric values in pack_log_into_event
in pipeline.yml. maybe_convert_str_to_num
should probably check if the input value is a string and if not, return the value directly. Either that or the check should be prior to the call to maybe_convert_str_to_num
in pack_log_into_event
.