SQLExecutor2 query_to_df avoid converting 'N/A' to NaN

Kok
Kok Registered Posts: 12

Hi,

I am using SQLExecutor2 python library in dataiku to execute a query from Oracle database. The default behavior of the method query_to_df converts the string 'N/A' to NaN. How can I change this? I would like to get the string value of 'N/A'.

Thanks.

Answers

  • Álvaro Andrés
    Álvaro Andrés Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 7 Dataiker

    Hello,

    Unfortunately, this is not possible when using SQLExecutor2. By default, all NULL, Nan, NA, and N/A are NaN for pandas, and there is no way to change this when using query_to_df.

    We'll take note of this and pass this request to our product team for future consideration.

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,160 Neuron

    I doubt the field is a string (varchar2 in Oracle) or that you have a string value of "N/A". Neither pandas nor Dataiku will convert a string column to a NaN. So you either have nulls or your column is not a string. Please check your data types of your input table in Oracle and your dataset schema settings in Dataiku and let us know the data types and what exactly is the column when you see a NaN in the output.

Setup Info
    Tags
      Help me…