dataframe-js icon indicating copy to clipboard operation
dataframe-js copied to clipboard

[BUG] Creating new DataFrame from array with duplicate column names

Open isaac-eiter opened this issue 4 years ago • 0 comments

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Create data array with random values, eg: [[1,2,3] , [4,5,6]]
  2. Create column array with duplicates, eg: ["Column1" , "Column2" , "Column1"]
  3. Create new DataFrame object
  4. The values in the DataFrame will be: [["Column1" , "Column2"] , [3,2] , [6,5]]

Expected behavior I would expect either an exception to be thrown "Duplicate columns detected, loss of data" or the second "Column1" to have a name such as "Column1-Duplicate1"

Desktop (please complete the following information):

  • Google Apps Script, server side

Additional context This generally isn't a problem once up and running, but I am using this api to read/write from google sheets by creating each sheet as a DataFrame. Any duplication of columns would be undetected and result in loss of data

isaac-eiter avatar Apr 23 '21 16:04 isaac-eiter