Closed apparao84 closed 4 months ago
@apparao84 If you wrap your code in triple backticks, it will format it as code.
print("formatted as code!")
@jorwoods We are not even able to retrieve/get any data from server.tasks library. Seems it is an issue with server.tasks library itself. If we run the same code for different library server.jobs or server.datasources we are able to print the data. We had this script running successfully for more than a year now and since last week it is not completing successfully.
We are running below same script provided in Tableau Server client API reference guide to print the data from server.tasks and getting below error.
Example code (Reference to code : https://tableau.github.io/server-client-python/docs/api-ref#tasks)
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])
Error we are getting:
C:\Python>python.exe C:\Refresh-Scripts\TableauExtractIncxxxx.py
Traceback (most recent call last):
File "C:\Python\Lib\site-packages\tableauserverclient\models\interval_item.py", line 181, in interval
if not (1 <= int(interval_value) <= 31):
^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'Second'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Refresh-Scripts\ableauExtractIncxxxx.py", line 23, in <module>
all_tasks, pagination_item = server.tasks.get()
^^^^^^^^^^^^^^^^^^
File "C:\Python\Lib\site-packages\tableauserverclient\server\endpoint\endpoint.py", line 205, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Lib\site-packages\tableauserverclient\server\endpoint\tasks_endpoint.py", line 37, in get
all_tasks = TaskItem.from_response(server_response.content, self.parent_srv.namespace, task_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Lib\site-packages\tableauserverclient\models\task_item.py", line 53, in from_response
return list(all_tasks)
^^^^^^^^^^^^^^^
File "C:\Python\Lib\site-packages\tableauserverclient\models\task_item.py", line 51, in <genexpr>
all_tasks = (TaskItem._parse_element(x, ns) for x in all_tasks_xml)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Lib\site-packages\tableauserverclient\models\task_item.py", line 64, in _parse_element
schedule_item_list = ScheduleItem.from_element(element, ns)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Lib\site-packages\tableauserverclient\models\schedule_item.py", line 223, in from_element
) = cls._parse_element(schedule_xml, ns)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Lib\site-packages\tableauserverclient\models\schedule_item.py", line 298, in _parse_element
interval_item = ScheduleItem._parse_interval_item(frequency_detail_elem, frequency, ns)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Lib\site-packages\tableauserverclient\models\schedule_item.py", line 276, in _parse_interval_item
return MonthlyInterval(start_time, interval_value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Lib\site-packages\tableauserverclient\models\interval_item.py", line 149, in __init__
self.interval = str(interval_value)
^^^^^^^^^^^^^
File "C:\Python\Lib\site-packages\tableauserverclient\models\interval_item.py", line 185, in interval
raise ValueError(error)
ValueError: Invalid interval value for a monthly frequency: Second.
C:\Python>
I realized we have an existing bug open to deal with these interval types, so I'll close this issue in favor of the existing #1358
Describe the bug When calling the IncrementalExtract refresh bridge refresh script as mentioned below We are getting below error. This worked successfully until last week.
Versions Details of your environment, including: Tableau Online Python version: 3.8 TSC library version 3.22
To Reproduce Steps to reproduce the behavior. Please include a code snippet where possible.
Results What are the results or error messages received?