rdomo Changed My Datatype

quachtoanlong
quachtoanlong Member
edited December 2023 in Connectors

Hi,

I am trying to upload a data frame from R environment to Domo using ds_update. One challenge that I am facing is that somehow DOMO automatically changed one column into Date, from numeric.

Because the value in that column ranged from 0 to around 890 thousand, I guess DOMO thought they were numerical date… (like in Excel).

Now I cannot switch them back to numeric either, DOMO said it does not support such operations.

What can I do to ensure the type of data when I upload from R?
Thank you

Best Answer

  • GrantSmith
    GrantSmith Coach
    edited December 2023 Answer ✓

    rdomo doesn't support defining the dataset's schema when you upload it. It attempts to determine the schema automatically. With your numbers it fails the first two checks where it's looking for a specific date format however the third check attempts to conver the number to a date which succeeds so it assumes it's a date. You can search for "typeConversionText=function(data, colindex)" on https://rdrr.io/github/domoinc/rdomo/src/R/rdomo.R to see the actual R code.

    The Python pydomo package does support defining a schema manually so that your data will be uploaded with the correct types if you're willing to use Python:

    https://github.com/domoinc/domo-python-sdk/blob/master/examples/dataset.py#L13

    Alternatively, you may be able to use a Magic ETL to change the data type with an Alter Column tile.

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**

Answers

  • GrantSmith
    GrantSmith Coach
    edited December 2023 Answer ✓

    rdomo doesn't support defining the dataset's schema when you upload it. It attempts to determine the schema automatically. With your numbers it fails the first two checks where it's looking for a specific date format however the third check attempts to conver the number to a date which succeeds so it assumes it's a date. You can search for "typeConversionText=function(data, colindex)" on https://rdrr.io/github/domoinc/rdomo/src/R/rdomo.R to see the actual R code.

    The Python pydomo package does support defining a schema manually so that your data will be uploaded with the correct types if you're willing to use Python:

    https://github.com/domoinc/domo-python-sdk/blob/master/examples/dataset.py#L13

    Alternatively, you may be able to use a Magic ETL to change the data type with an Alter Column tile.

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**