Skip to content

ValueError: project_id must be defined #974

Closed

Description

@hanishche

Hi,

I am running into error: ValueError: project_id must be defined.

Below is the code:

tsConn = TableauServerConnection('server_url','Token_name','token','site')
server = TSC.Server(tsConn.server_url, use_server_version=True)
tableau_auth = TSC.PersonalAccessTokenAuth(token_name=tsConn.token_name
                                           ,personal_access_token=tsConn.token_secret
                                           ,site_id=tsConn.site)
with server.auth.sign_in_with_personal_access_token(tableau_auth):
    print('[Logged in successfully to {}]'.format(tsConn.server_url))
    print('[Loading workbooks...]')        
    all_workbooks, pagination_item = server.workbooks.get()
    tableauWB = []
    for workbook in TSC.Pager(server.workbooks.get):
        tableauWB.append(
        (workbook.id
         ,workbook.name
         ,workbook.owner_id
         ,workbook.content_url
          ,'None' if len(workbook.project_id) ==0 else workbook.project_id
         ,workbook.project_name
         ,workbook.size
         ,'None' if len(workbook.tags) ==0 else workbook.tags
         ,pd.to_datetime(str(workbook.created_at)) 
         ,pd.to_datetime(str(workbook.updated_at)) 
         ,workbook.webpage_url       ))

print('[Tableau {} workbooks loaded]'.format(len(tableauWB)))

image

Activity

  1. bcantoni commented on Jan 19, 2022

    @bcantoni
    Contributor

    May be similar to #930

  2. hanishche commented on Jan 19, 2022

    @hanishche
    Author

    Yes it is similar to #930 , do we have any solution for this ?

  3. jpsued commented on Feb 1, 2022

    @jpsued

    Hi together,
    I'm getting this error after we upgraded from Tableau Server version 2020.2.4 to 2021.3.6.
    All data sources / workbooks I'm getting the error for are located in the new introduced 'Personal Space'
    Maybe this helps to track down/handle the issue.

  4. Planswalker commented on Mar 28, 2022

    @Planswalker

    Hi everyone,

    I'm also running into this exact issue when trying to query all workbooks. I can also confirm that this is related to the "Personal Space" feature, which would make sense since if I'm understanding the wording in https://help.tableau.com/current/pro/desktop/en-us/personal_space.htm correctly, Workbooks created in a Personal Space aren't associated with a project by design.

    Is there a reason that the project_id field is required for creating a workbook? Or can we make that an optional parameter without issue?

  5. bcmyguest1 commented on Apr 28, 2022

    @bcmyguest1
    Contributor

    Left a PR to remove the requirement for project_id to not be None. The requirement for it to be non-null was added in 2016, long before the personal space feature. The workbook object returned in XML does not contain a project_id, so the facade (TSC) should not require it.

  6. added and removed
    needs investigationIssue needs to be looked at by Tableau
    on May 15, 2022
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions