[Python] Adding the Site name in a separate column - Python vs Tableau Server

Discussão em 'Python' iniciado por Stack, Março 26, 2025.

  1. Stack

    Stack Membro Participativo

    I wrote the below python code to export the users list from tableau server and it perfectly works for extracting data from one single site. But lets say we need to extract the data from multiple sites in the same time, then tableau gives me an error.

    tis is the code I ran

    from tableau_api_lib import TableauServerConnection
    import pandas as pd
    from tableau_api_lib.utils.querying import get_users_dataframe

    tableau_server_config = {
    'my_env': {
    'server': 'https://myserver.com',
    'api_version': '3.21',
    'username': 'user',
    'password': 'pass',
    'site_name': ['FT','INT','ss'],
    'site_url': ['FT','INT','ss']
    }
    }


    conn = TableauServerConnection(tableau_server_config, env='my_env')
    conn.sign_in()
    users_df = get_users_dataframe(conn=conn)
    users_df.drop(columns=['domain', 'externalAuthUserId', 'locale','language'], inplace=True)
    print(users_df)


    error -

    PaginationError:
    The Tableau Server REST API method decorator did not return paginated results.
    Please verify that your connection is logged in and has a valid auth token.
    If using personal access tokens, note that only one session can be active at a time using a single token.
    Also note that the extract_pages() method wrapping this call is intended for paginated results only.
    Not all Tableau Server REST API methods support pagination.


    Is there any way to solve this issue? and in front the output i need to get the site name as well.

    any one can help me out?

    thanks

    Continue reading...

Compartilhe esta Página