Skip to content

virtual connection's connection object does not have username field #1626

@kakarukeys

Description

@kakarukeys

Describe the bug
virtual connection's connection object does not have username field

Versions
Details of your environment, including:

  • Tableau Online
  • Python 3.11.9
  • TSC library version 0.37

To Reproduce

configure an athena type virtual connection with IAM user credentials on the UI

def gen_connections(endpoint: Any) -> Iterator[ConnectionItem]:
    for obj in TSC.Pager(endpoint):
        endpoint.populate_connections(obj)

        obj_connections = obj.connections

        for conn in obj_connections:
            yield conn.username

print(list(gen_connections(server.virtual_connections)))

Results
a list of None objects

the xml response from the API call contains a field "username" that has the username, however this line gets from "userName", https://github.com/tableau/server-client-python/blob/28860189f440b180fed1488c9b93b51118b030ba/tableauserverclient/models/connection_item.py#L111C40-L111C76

relevant API doc: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_virtual_connections.htm#list_virtual_connection_database_connections

<tsResponse>
  <pagination pageNumber="pageNumber" pageSize="page-size" totalAvailable="total-available" />
  <virtualConnectionConnections>
    <connection
      id="connection-id" 
      serverAddress="server-address" 
      dbClass="database-type" 
      serverPort="port-number" 
      userName="connection-user-name"/>
  </virtualConnectionConnections>
</tsResponse>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions