Skip to content

CSVImport._evaluate_site_role returns Unlicensed when any role column is empty; the server fills each missing part separately #1937

Backlog

Description

@jacalata

UserItem.CSVImport._evaluate_site_role returns Unlicensed whenever the license, admin or publisher value is empty. The CSV guidelines allow blank columns, and tabcmd Classic, which sends the file to the server, builds a role from the values that are present, so a row with only some columns can get a different role from TSC.

Example
user1,,,viewer (license given, admin and publisher blank):

  • TSC: _evaluate_site_role("viewer", "", "") returns Unlicensed.
  • tabcmd Classic: treats a blank admin value as none and a blank publishing value as no, so the user becomes Viewer. I have not run this live, because it needs a site where the account can manage users; I am reporting how Classic behaves for a row like this, not a measurement.

What the documentation says
The CSV guidelines say "Not all columns need to be filled out, but the required column structure must be preserved by including all the expected comma delimiters", and map (license, admin, publishing) combinations to site roles, for example Viewer is (Viewer, None, False). They do not state what a blank value means.

What TSC does

if not license_level or not admin_level or not publisher:
    return "Unlicensed"

(tableauserverclient/models/user_item.py, _evaluate_site_role.) This applies on master and in 0.42, and is used by create_user_from_line and create_from_file.

Proposal
Fill each blank part separately instead of returning Unlicensed immediately: a blank license means Unlicensed, a blank publisher means no, a blank admin means none. Then build the role from the three values with the existing rules. If the intended meaning of a blank value is different, the CSV guidelines should say so.

Why it matters
tabcmd 2 has its own copy of the same early return, so it gives Unlicensed where Classic gives Viewer. Fixing TSC lets tabcmd 2 use TSC's function for its CSV import instead of keeping a copy (see #1809).

Activity

  1. added
    tabcmd
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tabcmd

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions