Skip to content

datasource item nullable project #1210

Description

@peter-malcolm-bw

Describe the bug
A clear and concise description of what the bug is.

Versions
Details of your environment, including:

  • Tableau Server version (or note if using Tableau Online) - Tableau Online
  • Python version: 3.9.12
  • TSC library version: 0.24

To Reproduce
Steps to reproduce the behaviour. Please include a code snippet where possible.

import tableauserverclient as TSC

# log in to tableau server 

for datasource in TSC.Pager(server.datasources):
      print(datasource)

The error can be fixed by removing one line from datasource_item.py:

class DatasourceItem(object):
    
    ...
    
    @project_id.setter
    #@property_not_nullable  # TODO: remove this line 
    def project_id(self, value: str):
        self._project_id = value

Results
What are the results or error messages received?

src/tableau_bot/refresh.py:142: in tableau_refresh
    for datasource in Pager(server.datasources):
../../Library/Caches/pypoetry/virtualenvs/tableau-bot-sFRF_OxE-py3.9/lib/python3.9/site-packages/tableauserverclient/server/pager.py:40: in __iter__
    current_item_list, last_pagination_item = self._endpoint(self._options)
../../Library/Caches/pypoetry/virtualenvs/tableau-bot-sFRF_OxE-py3.9/lib/python3.9/site-packages/tableauserverclient/server/endpoint/endpoint.py:205: in wrapper
    return func(self, *args, **kwargs)
../../Library/Caches/pypoetry/virtualenvs/tableau-bot-sFRF_OxE-py3.9/lib/python3.9/site-packages/tableauserverclient/server/endpoint/datasources_endpoint.py:77: in get
    all_datasource_items = DatasourceItem.from_response(server_response.content, self.parent_srv.namespace)
../../Library/Caches/pypoetry/virtualenvs/tableau-bot-sFRF_OxE-py3.9/lib/python3.9/site-packages/tableauserverclient/models/datasource_item.py:331: in from_response
    datasource_item = cls(project_id)
../../Library/Caches/pypoetry/virtualenvs/tableau-bot-sFRF_OxE-py3.9/lib/python3.9/site-packages/tableauserverclient/models/datasource_item.py:58: in __init__
    self.project_id = project_id
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <tableauserverclient.models.datasource_item.DatasourceItem object at 0x10995cdf0>, value = None

    @wraps(func)
    def wrapper(self, value):
        if value is None:
            error = "{0} must be defined.".format(func.__name__)
>           raise ValueError(error)
E           ValueError: project_id must be defined.

NOTE: Be careful not to post user names, passwords, auth tokens or any other private or sensitive information.

Activity

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