Skip to main content

#User토론 중인 항목 0개

Gerard Scheitlin 님이 #Tableau Prep에 질문했습니다

As I am a small business and do not want to pay for Data Management, and hence Tableau Prep Conductor, I run my flows from the command line on a scheduler.

 

From what I can tell, you have to be a creator to send outputs to a published data source (Tableau Online). With the recent change in authentication requirements, you have to use MFA (Google Auth) to sign into Tableau online. Therefore, my current credentials file does not work and I cannot find anything that tells me how to set it up for MFA.

 

Can somebody please help me understand how to either:

  1. Change my credentials file for MFA
  2. Allow an Explorer (Can Publish) to be able to publish output data files to Tableau Online so I can use Tableau Authentication for the explorer and the standard credentials file.

 

I have attached the most recent roles chart that I can find. This shows that you have to be a creator to "Create Data Sources", which is what appears to be needed for Tableau Prep to publish to an online data source.

 

Thanks

답변 2개
  1. 2023년 5월 2일 오후 6:24

    @Gerard Scheitlin​ 

    Hi, your options are quite small. Unfortunatelly, prep command line does not support MFA or PAT authentication.

     

    Option 1:

    You may publish your flow to Tableau Cloud, and use a script to run the flow directly in Tableau Cloud using tableau server client. The down side is that if you don't have Data Management Add On, you only have 1 hour of flow runs per each creator license. This approach uses PAT to sign in to Tableau Cloud.

    https://community.tableau.com/s/question/0D58b0000Az28bjCQA/schedule-refresh-flow

    https://help.tableau.com/current/online/en-us/security_personal_access_tokens.htm

     

    Option 2:

    You may create a hyper file from your flow, so you won't need to login to Tableau Cloud (unless you use published data sources in your flow as inputs), and then publish the hyper file using tableau server client. You may use a python code like:

    import tableauserverclient as TSC

    from pathlib import Path

     

    # server admin creds

    HOST="https://prod-useast-b.online.tableau.com"

    #Use the following to use User and password

    #USER="username"

    #PWRD="password"

    #When using PAT Sign in

    TOKENNAME="your_token_name"

    TOKENID="your_token_key-id"

    #Use "" to default site

    SITE="yoursiteurl"

    #Use "" to default project

    PROJECT_NAME="Your Project Name"

    ASYNC = True

    FILE = "yourhypernamefile.hyper"

    DSNAME ="Your Desired Published DS Name"

     

    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 for 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

Hello,

I know there are similar questions regarding site ID and also publishing hyper files into Tableau Online, however, I could not find one where the problem was the same as mine.

I have tried both with personal credentials and with token (functions 'TSC.TableauAuth' and 'TSC.PersonalAccessTokenAuth') and the error is always the same while trying to sign in ('Not Signed Error: Missing site ID. You must sign in first'). I do have set a site ID (the one which is in the URL after 'site/').

Could you help me on that, please?

Thanks

답변 8개
  1. 2022년 11월 18일 오후 12:01

    @Augusto Cardoso​ 

    Hi, I tested the code provided yesterday and it worked!!!. So, probably the error is in how are you defining the parameters, specifically the site_id. So let's say you sign in into the url in a browser:

    https://prod-uk-a.online.tableau.com/#/site/mod398492/home

     

    server_address = 'https://prod-uk-a.online.tableau.com'

    site_id = 'mod398492'

     

    If neccesary recreate the PAT token: https://help.tableau.com/current/pro/desktop/en-us/useracct.htm#create-and-revoke-personal-access-tokens

     

    If it keep failing, I would suggest to upgrade the tableauserverclient lybrary (maybe you have an old one).

     

    Believe me, the code I posted works. From my side, I really can't do anything else. You may need to work on how you adapted to your final code. It may be when you assign the value to the {site_id]

     

    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

Hello @* Marketing Cloud Growth & Advanced *

 

The @Salesforce Research Program is interested in speaking with Salesforce Marketing Cloud Growth/Advanced users to better understand your obstacles and experiences. 

 

We invite you to participate in a 60-minute feedback session conducted remotely over Google Meet. 

 

This is strictly for research purposes only.  

 

Participants chosen to participate will receive a 

$100 e-gift card as a small token of appreciation for your very valuable feedback and time. If you would be interested in being considered for this study and our other active Marketing Cloud research , please fill out this survey. 

 

Thank you,

Erika Trageser

Research Operations Program Manager

#CommUpdates #TrailblazerCommunity#TrailblazerCommunity #Agentforce #MarketingCloudGrowth

0/9000
답변 4개
  1. 2023년 11월 24일 오후 1:07

    @Nupur Gupta​ 

    Hi, you have some options:

     

    Option 1:

    Publish the flow to Tableau Cloud/Server and run it manually from the flow page.

     

    Option 2:

    Run your flow locally in your computer using Tableau Prep Builder configuring the Output to a published data source.

     

    Option 3:

    You may create a hyper file from your flow using tableau prep builder command line and save the hyper file locally in your computer

    https://help.tableau.com/current/prep/en-us/prep_run_commandline.htm

     

    Then publish the hyper file using tableau server client. You may use a python code like (notice you will need to create a Personal Access Token: https://help.tableau.com/current/online/en-us/security_personal_access_tokens.htm)

    import tableauserverclient as TSC

    from pathlib import Path

    # server admin creds

    HOST="https://prod-useast-b.online.tableau.com"

    #Use the following to use User and password

    #USER="username"

    #PWRD="password"

    #When using PAT Sign in

    TOKENNAME="your_token_name"

    TOKENID="your_token_key-id"

    #Use "" to default site

    SITE="yoursiteurl"

    #Use "" to default project

    PROJECT_NAME="Your Project Name"

    ASYNC = True

    FILE = "yourhypernamefile.hyper"

    DSNAME ="Your Desired Published DS Name"

    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 for 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
Jaden Hunter 님이 #Tableau Cloud에 질문했습니다

I'm wondering if it is at all possible to skip the workbook step to publish my already created Hyper files. And I'm also wondering if I should just upload my data and let Tableau Desktop extract my data into hyper files. Any help or clarification on this would be much appreciated. Thanks!

답변 2개
0/9000

I’m the only one using Salesforce (Real Estate agent). Is it normal to have my admin account and run my regular business? Or, should I add myself as a user and work under that profile? I’m new to Salesforce and working through the training but it’s overwhelming at times trying to just get the ball rolling on implementation. It feels like I’m building everything from scratch rather than an out of the box CRM. Any insights/help would be appreciated

#Newbie #Trailhead #System Administrator Profile #User #Training
0/9000

I want to create a new checkbox field on the User object which should be checked if it is within the user's working hours and should be unchecked as soon it's outside the user's working hours. Please let me know how to achieve this.

#user  

0/9000

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

I have code where I'm definitely giving the site ID

 

tableau_auth = TSC.TableauAuth(username=os.environ['SOMEUID'], password=os.environ['SOMEPASSWORD'], site_id ='mysite')

server = TSC.Server('https://us-east-1.online.tableau.com/', use_server_version=True)

 

 

with sign_in(): #just keeps doing server.auth.sign_in(tableau_auth) until returns a good connection

project = get_project(project_path) # just gets the project based on `/a/b/c` path

# Create the datasource object with the project_id

new_datasource = TSC.DatasourceItem(project.id)

# publish data source (specified in file_path)

try:

server.datasources.publish(

new_datasource, file_name, mode="CreateNew"

# , as_job=True

)

except TSC.ServerResponseError as e:

logger.info(f"Overwriting '{file_name}' in '{project.name}'")

new_datasource = server.datasources.publish(

new_datasource, file_name, mode="Overwrite")

except Exception as e:

logger.error(f"Problem Publishing '{file_name}' in '{project.name}'", exc_info=e)

raise

But this only happens when publishing the datasource. my other calls to sign_in work just fine.

답변 1개
  1. 2023년 1월 20일 오후 7:21

    @Vince Faller​ 

    Hi, you may try with a code I have written, for login I use PAT (Personal Access Token). As you may know, MFA would be a requirement, and after that you would need to user

     

    import tableauserverclient as TSC

    from pathlib import Path

    # server admin creds

    HOST="https://us-east-1.online.tableau.com/"

    #USER="youruser"

    #PWRD="yourpassword"

    TOKENNAME="tokenname"

    TOKENID="xyw==:55hP"

    #Use "" to default site

    SITE="yoursite"

    #Use "" to default project

    PROJECT_NAME="World Indicators"

    ASYNC = True

    FILE = "Devoluciones.hyper"

    DSNAME ="Devoluciones"

    server = TSC.Server(HOST, use_server_version=True)

    #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=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

     

    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

Our API version is 3.11 and I won't be able to get our IT guys to upgrade. So crud with a hyper file isn't possible.

 

The below code is currently working fine with an exeption. The hyper_name below is prebuilt in a prior snippet, but in testing I've limited it's rows to 1000. Makes this code work fine. It publishes a hyper file, with 1000 rows in it. All pre-built using PySpark (so a dataframe in to the hyper file).

from pathlib import Path

path_to_database = Path(hyper_name)

project_name = 'Testing'

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

# Create the datasource object with the project_id

datasource = TSC.DatasourceItem(project_id)

print(f"Publishing {hyper_name} to {project_name}...")

# Publish datasource

datasource = server.datasources.publish(datasource, path_to_database, publish_mode, as_job=True)

print("Datasource published. Datasource ID: {0}".format(datasource.id))

The problem arises when I remove the limit of 1000 rows, and let all the rows through (approx 500K). I get the following errors. (can't paste the whole output)

 

ConnectionError: ('Connection aborted.', BrokenPipeError(32, 'Broken pipe'))

 

 Please help. Losing my mind over this.

답변 5개
  1. 2022년 9월 29일 오후 4:52

    @Tapaha Robati​ 

    I use the folliwing code, and it works:

    import tableauserverclient as TSC

    from pathlib import Path

     

    # server admin creds

    HOST="https://www.yourserver.com"

    #USER="youruser"

    #PWRD="yourpassword"

    TOKENNAME="tokenname"

    TOKENID="xyw==:55hP"

    #Use "" to default site

    SITE="Entrenamiento"

    #Use "" to default project

    PROJECT_NAME="World Indicators"

    ASYNC = True

    FILE = "Devoluciones.hyper"

    DSNAME ="Devoluciones"

     

    server = TSC.Server(HOST, use_server_version=True)

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

    Maybe updating tsc:

    pip install --upgrade tableauserverclient

    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