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

Not able to publish 6gb hyper file to tableau server #1249

Closed
patilmadhu opened this issue Jun 22, 2023 · 1 comment
Closed

Not able to publish 6gb hyper file to tableau server #1249

patilmadhu opened this issue Jun 22, 2023 · 1 comment
Labels
help wanted A user needs help, may be a mistake, a bug or a feature request perf

Comments

@patilmadhu
Copy link

Versions
Details of your environment, including:

  • Tableau Server version (or note if using Tableau Online)
  • python 3.8
  • TSC 0.26

To Reproduce
import tableauserverclient as TSC
from pathlib import Path

server admin creds

HOST="https://www.yourserver.com"
#Use the following to use User and password
#USER="youruser"
#PWRD="yourpassword"
TOKENNAME="tokenname"
TOKENID="SF1GzE0yyw==:55h2h"
#Use "" to default site
SITE="yoursiteurl"
#Use "" to default project
PROJECT_NAME="World Indicators"
ASYNC = True
FILE = "filename.hyper"
#DATASOURCE NAME
DSNAME ="Devoluciones"

server = TSC.Server(HOST, use_server_version=True)
#Use the following to sign in with user and password
#tableau_auth = TSC.TableauAuth(USER,PWRD,site=SITE)
tableau_auth = TSC.PersonalAccessTokenAuth(TOKENNAME, TOKENID, site_id=SITE)

PATH_TO_FILE = Path(FILE)
with server.auth.sign_in(tableau_auth):
# Define publish mode - Overwrite, Append, or CreateNew
publish_mode = TSC.Server.PublishMode.Overwrite

    # Get project_id from PROJECT_NAME
    all_projects, pagination_item = server.projects.get()
    for project in TSC.Pager(server.projects):
        if project.name == PROJECT_NAME:
            project_id = project.id
			
    new_conn_creds = None

    # Create the datasource object with the project_id
    datasource = TSC.DatasourceItem(project_id)
    new_datasource = TSC.DatasourceItem(project_id=project_id,name=DSNAME)
    
    print(f"Publishing {FILE} to {PROJECT_NAME}...")
    # Publish datasource
    if ASYNC:
        # Async publishing, returns a job_item
        new_job = server.datasources.publish(datasource, PATH_TO_FILE, publish_mode, connection_credentials=new_conn_creds, as_job=ASYNC)
        print("Datasource published asynchronously. Job ID: {0}".format(new_job.id))
    else:
        # Normal publishing, returns a datasource_item
        new_datasource = server.datasources.publish(datasource, PATH_TO_FILE, publish_mode,connection_credentials=new_conn_creds)
        print("Datasource published. Datasource ID: {0}".format(new_datasource.id))

#Don't forget to sign out
server.auth.sign_out()
Results
Async request failed: retrying
Blocking request to https:/site_address/api/3.12/sites/someid/fileuploads/someid

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

@jacalata jacalata added bug help wanted A user needs help, may be a mistake, a bug or a feature request perf and removed bug labels May 23, 2024
@jacalata
Copy link
Contributor

This is trying to use the async code that is now removed, but I don't think it would work on the current code either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted A user needs help, may be a mistake, a bug or a feature request perf
Projects
None yet
Development

No branches or pull requests

3 participants