Skip to main content

Hello,

So I have a flow published and connected to data sources on Server 1. I have a workbook published on Server 2 that uses that flow (with local copy method). But when I run the update on flow, workbook cant pull updated data. and the connection type says hyper_0.hyper (...), I think it cant be updated because its hyper link connection instead of standard server connection. is there a workaround for this data update issue?

 

And another question also related to this problem, when I extract datasource, I cant publish it to another server, I get an error: This workbook contains a data source that is dependent on a different Tableau Server. only create local copy and then publish works. I suppose extracts cant be published to different servers?

1 个回答
  1. 2023年3月31日 12:32

    @Nugzari Geladze​ 

    Hi, If understand you have to Tableau Server installs, you use Server 1 to refresh a hyper file to a shared location, that is used by Server 2.

     

    If this is the case, probably the problem is that when Server 1 tries to refresh file, and if Server 2 is using the file, then the file can't be overwrite, because it is blocked by shared use file. A typical example is when you have an Excel file open and you try to delete it. You can't.

     

    The second is as you say, you can't publish a datasource using a flow from one server to another server.

     

    So, what to do? You can use REST API. You could use something like a python code, to read the hyper file from the shared folder and publish as a published datasource to the second server.

     

    Below an example code

    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"

     

    #If using PAT use the following

    TOKENNAME="tokenname"

    TOKENID="xuf+yyw==:55h2hkld3wEP"

    #Use "" to default site

    SITE="Entrenamiento"

    #Use "" to default project

    PROJECT_NAME="World Indicators"

    ASYNC = True

    FILE = "Devoluciones.hyper"

    //Data Source 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)

     

    #Use the following if using PAT

    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()

    If this post resolves the question, would you be so kind to "Select as Best"?. This will help other users find the same answer/resolution and help community keep track of answered questions. Thank you.

     

    Regards,

     

    Diego Martinez

    Tableau Visionary and Forums Ambassador

0/9000