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 ValueError: name must be defined. #1237

Closed
segunskl opened this issue May 24, 2023 · 8 comments
Closed

server.tasks ValueError: name must be defined. #1237

segunskl opened this issue May 24, 2023 · 8 comments

Comments

@segunskl
Copy link

Describe the bug
I can use this code to get all tasks in my tableau online since last year. But today this code return error like this. How to fix the error?

Versions
Details of your environment, including:

  • Tableau Server version (or note if using Tableau Online) > Tableau Online
  • Python version > 3.8
  • TSC library version > 0.25

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

server = TSC.Server(TABLEAU_URL, use_server_version=True)
server.auth.sign_in(tableau_auth)
all_tasks = list(TSC.Pager(server.tasks))

Results
What are the results or error messages received?

image

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

@stav-hacohen
Copy link

We are facing the same issue. Seems like a change in tableau backend. Please advice.

@pavel-sho
Copy link

seems like element object <Element '{http://tableau.com/api}schedule' at 0x7fdda840e1d0> ,
returned object

schedule_xml.items()
[('frequency', 'Monthly'), ('nextRunAt', '2023-06-01T09:00:00Z')]

the name is not presented in the response from tableau.com

@jacalata
Copy link
Contributor

Yes, it is a server change, the fix will be to remove the non-nullable attribute so the library accepts the new object.

@jacalata jacalata added the bug label May 24, 2023
@pavel-sho
Copy link

Hi @jacalata, is there a way to prioritize this bug or at least getting some ETA for a fix?

Thanks

@SQLShortReads
Copy link

@pavel-sho Out of curiosity, is this supposed to return flow tasks as well? When I attempt to retrieve all tasks, I can only ever retrieve those associated with Extract Refreshes, despite being able to view those associated with Flows, Subscriptions, Alerts, and Linked Task on Tableau Server's front-end as a site admin.

@pavel-sho
Copy link

Hi @SQLShortReads, you right, the purpose we use tasks service, is to check which workbook_id / datasource_id has incremental refresh, if there is any we trigger it, as part of orchestration we do via Airflow, currently Tableau supports only full refresh when using their Airflow Operator, supporting incremental refresh require some dirty tricks.

austinpeters-gohealthuccom added a commit to austinpeters-gohealthuccom/server-client-python that referenced this issue Jun 7, 2023
@austinpeters-gohealthuccom
Copy link
Contributor

Hey all, because I keep getting the short end with Tableau Support (a repeat trend for my org, how about you all?), I made a hotfix for this. Check the PR out above, there's only a few small changes you need to do to fix this bug.

If you need to apply it yourself to patch a pip installed copy and don't know how to make a modified package from a git yourself, here's my lazy approach:

  1. in windows file explorer, go to *%appdata%\Python\Python310\site-packages\tableauserverclient\models*
  2. (if you're not using Python 3.10 or have it installed elsewhere, change the URI as needed)
  3. Replace the schedule_item.py file there with the file from the pull request.
  4. Restart whatever code/program you're running, so your python environment refreshes.

@SQLShortReads
Copy link

SQLShortReads commented Jul 18, 2023

Has anyone been able to successfully retrieve data on scheduled flow tasks? As previously stated, only extractRefresh tasks seem to be returned by server.tasks.

To be clear, in the front-end UI, there are 6 categories of tasks, and server.tasks only returns those tasks that are of Extract Refresh type.
Extract Refreshes
Flows
Subscriptions
Alerts
Accelerated Views
Linked Tasks.

jacalata pushed a commit that referenced this issue Aug 1, 2023
Co-authored-by: Tim Payne <47423639+ma7tcsp@users.noreply.github.com>
Hotfix for #1237
jacalata pushed a commit that referenced this issue Aug 1, 2023
Co-authored-by: Tim Payne <47423639+ma7tcsp@users.noreply.github.com>
Hotfix for #1237
@jacalata jacalata added the fixed label Aug 1, 2023
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