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

server.tasks.get() error #1502

Open
CAP-JForlow opened this issue Oct 15, 2024 · 1 comment
Open

server.tasks.get() error #1502

CAP-JForlow opened this issue Oct 15, 2024 · 1 comment

Comments

@CAP-JForlow
Copy link

CAP-JForlow commented Oct 15, 2024

Describe the bug
I am using the example code:

import tableauserverclient as TSC
tableau_auth = TSC.TableauAuth('USERNAME', 'PASSWORD')
server = TSC.Server('https://SERVERURL')

with server.auth.sign_in(tableau_auth):
    all_tasks, pagination_item = server.tasks.get()
    print("\nThere are {} tasks on site: ".format(pagination_item.total_available))
    print([task.id for task in all_tasks])

Versions
Details of your environment, including:

  • Tableau Online

  • Tableau Server Version: 2024.3.0 (20243.24.1002.0933) 64-bit Linux
    Tableau Pod: prod-useast-b

  • Python version

  • Python 3.10.0

  • TSC library version

  • Downloaded Oct 1 2024

To Reproduce
Run code above ( I have omitted the connection steps, but am using the same code in other scripts successfully)

Results
What are the results or error messages received?

Traceback (most recent call last):
  File "C:\Users\jforlow\AppData\Local\Programs\Python\Python310\lib\site-packages\tableauserverclient\models\interval_item.py", line 259, in interval
    if not (1 <= int(interval_value) <= 31):
ValueError: invalid literal for int() with base 10: 'Sunday'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\# Tableau_Cloud_PY\explore_tasks.py", line 184, in <module>
    main()
  File "C:\# Tableau_Cloud_PY\explore_tasks.py", line 110, in main
    all_tasks, pagination_item = server.tasks.get()
  File "C:\Users\jforlow\AppData\Local\Programs\Python\Python310\lib\site-packages\tableauserverclient\server\endpoint\endpoint.py", line 254, in wrapper
    return func(self, *args, **kwargs)
  File "C:\Users\jforlow\AppData\Local\Programs\Python\Python310\lib\site-packages\tableauserverclient\server\endpoint\tasks_endpoint.py", line 43, in get
    all_tasks = TaskItem.from_response(server_response.content, self.parent_srv.namespace, task_type)
  File "C:\Users\jforlow\AppData\Local\Programs\Python\Python310\lib\site-packages\tableauserverclient\models\task_item.py", line 57, in from_response
    return list(all_tasks)
  File "C:\Users\jforlow\AppData\Local\Programs\Python\Python310\lib\site-packages\tableauserverclient\models\task_item.py", line 55, in <genexpr>
    all_tasks = (TaskItem._parse_element(x, ns) for x in all_tasks_xml)
  File "C:\Users\jforlow\AppData\Local\Programs\Python\Python310\lib\site-packages\tableauserverclient\models\task_item.py", line 68, in _parse_element
    schedule_item_list = ScheduleItem.from_element(element, ns)
  File "C:\Users\jforlow\AppData\Local\Programs\Python\Python310\lib\site-packages\tableauserverclient\models\schedule_item.py", line 223, in from_element
    ) = cls._parse_element(schedule_xml, ns)
  File "C:\Users\jforlow\AppData\Local\Programs\Python\Python310\lib\site-packages\tableauserverclient\models\schedule_item.py", line 316, in _parse_element
    interval_item = ScheduleItem._parse_interval_item(frequency_detail_elem, frequency, ns)
  File "C:\Users\jforlow\AppData\Local\Programs\Python\Python310\lib\site-packages\tableauserverclient\models\schedule_item.py", line 294, in _parse_interval_item
    return MonthlyInterval(start_time, tuple(interval_values))
  File "C:\Users\jforlow\AppData\Local\Programs\Python\Python310\lib\site-packages\tableauserverclient\models\interval_item.py", line 222, in __init__
    self.interval = interval_value
  File "C:\Users\jforlow\AppData\Local\Programs\Python\Python310\lib\site-packages\tableauserverclient\models\interval_item.py", line 263, in interval
    raise ValueError(error)
ValueError: Invalid interval value for a monthly frequency: Sunday.
@bcantoni
Copy link
Contributor

bcantoni commented Nov 3, 2024

@CAP-JForlow we had a bug recently fixed related to this #1462.

What version of the TSC client library are you using? This issue was fixed in 0.33.

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

2 participants