Skip to content

Inconsistency in handling column name uniqueness and case-sensitivity for data export #86

@tibco-slolla

Description

@tibco-slolla

It appears that column names for tables in Spotfire have to be unique and are case-insensitive. So, when pasting data from clipboard:

Example-1:

Data copied into Clipboard:

CAT CAT CAT
1 2 3
4 5 6
7 8 9

becomes:

CAT CAT (2) CAT (3)
1 2 3
4 5 6
7 8 9

Example-2:

Data copied into Clipboard:

cat cAt CAT
1 2 3
4 5 6
7 8 9

becomes:

cat cAt (2) CAT (3)
1 2 3
4 5 6
7 8 9

Pandas dataframes can be non-unique column names. Pandas dataframe column names are also case sensitive. sbdf.export_data fails to export a pandas data frame with column names as shown in example 1 but allows export of data with column names as shown in example 2.

This fails:

import pandas as pd
import spotfire

data = pd.DataFrame(
    [[1, 2, 3],
    [4, 5, 6],
    [7, 8, 9]],
    columns=["CAT", "CAT", "CAT"]
)

spotfire.sbdf.export_data(
    data,
    "duplicate_column_names.sbdf",
)

This succeeds:

import pandas as pd
import spotfire

data = pd.DataFrame(
    [[1, 2, 3],
    [4, 5, 6],
    [7, 8, 9]],
    columns=["cat", "cAt", "CAT"]
)

spotfire.sbdf.export_data(
    data,
    "column_name_case_sensitivity.sbdf",
)

This appears inconsistent -- it might be better if sbdf.export_data either supports both cases or fails for both.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions