8000 ValueError: project_id must be defined · Issue #974 · tableau/server-client-python · GitHub
[go: up one dir, main page]

Skip to content
8000

ValueError: project_id must be defined #974

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

Closed
hanishche opened this issue Jan 18, 2022 · 5 comments
Closed

ValueError: project_id must be defined #974

hanishche opened this issue Jan 18, 2022 · 5 comments

Comments

@hanishche
Copy link
hanishche commented Jan 18, 2022

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

@bcantoni bcantoni added the needs investigation Issue needs to be looked at by Tableau label Jan 19, 2022
@bcantoni
Copy link
Contributor

May be similar to #930

@hanishche
Copy link
Author

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

@jpsued
Copy link
jpsued commented Feb 1, 2022

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.

@Planswalker
Copy link

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?

@bcmyguest1
Copy link
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.

@jacalata jacalata added bug fixed and removed needs investigation Issue needs to be looked at by Tableau labels May 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants
0