Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using querying.get_workbooks_dataframe(conn) it throws pagination error #108

Open
dbodduluru opened this issue Jan 9, 2023 · 6 comments

Comments

@dbodduluru
Copy link

Exception has occurred: 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. 

During handling of the above exception, another exception occurred:

@gvidoausejs
Copy link

gvidoausejs commented Feb 22, 2023

Just experienced this error after Tableau Server upgrade to 2022.3 from older version.
Fixed with updating module to latest:
pip install tableau-api_lib --upgrade

Successfully uninstalled tableau-api-lib-0.1.28
Successfully installed tableau-api-lib-0.1.50

I suggest checking if not experiencing error due to outdated module.

@navedgaras
Copy link

I started experiencing the same issue even though I'm using tableau-api-lib-0.1.50

@divinorum-webb
Copy link
Owner

@edgga what version is your server on, or are you using Tableau Online?

I just successfully ran the get_workbooks_dataframe utils function against my test environment on Tableau Server:
'serverInfo': {'productVersion': {'value': '2022.3.4', 'build': '20223.23.0214.1014'}

Maybe good to verify that the account you are using to do the querying has permissions to at least 1 project/workbook in your environment, as it's possible the pagination error could be happening due to no content being available to paginate over.

@nnd-support
Copy link

Getting the same error:

  File "/usr/local/lib/python3.7/site-packages/tableau_api_lib/utils/pagination.py", line 23, in get_page_attributes
    pagination = query["pagination"]
KeyError: 'pagination'
  File "/usr/local/lib/python3.7/site-packages/tableau_api_lib/utils/querying/workbooks.py", line 24, in get_workbooks_dataframe
    workbooks_df = pd.DataFrame(get_all_workbook_fields(conn=conn, all_fields=all_fields))
  File "/usr/local/lib/python3.7/site-packages/tableau_api_lib/utils/querying/workbooks.py", line 17, in get_all_workbook_fields
    all_workbooks = extract_pages(conn.query_workbooks_for_site, parameter_dict={"fields": f"fields={fields_param}"})
  File "/usr/local/lib/python3.7/site-packages/tableau_api_lib/utils/pagination.py", line 62, in extract_pages
    page_number, page_size, total_available = get_page_attributes(query=query_results, query_func=query_func)
  File "/usr/local/lib/python3.7/site-packages/tableau_api_lib/utils/pagination.py", line 29, in get_page_attributes
    raise PaginationError(query_func)
tableau_api_lib.exceptions.tableau_server_exceptions.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. 

With Tableau Server version 2022.1 (API version 3.15) and tableau-api-lib-0.1.50

@Sushrut773
Copy link

Sushrut773 commented Aug 23, 2024

I am facing same error. How to resolve this issue ?

@nnd-support
Copy link

I am facing same error. How to resolve this issue ?

We ended up resolving it by correcting the Site URL that we were using in our code. So, my only recommendation would be to double check and make sure the URL for API endpoint that your code is accessing is accurate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants