Skip to content

Would be possible to add an option to have incremental refresh for workbooks or datasources? #761

Closed

Description

@smafra

Would be nice if we can have in refresh.py a incremental or full refresh option on workbooks/dasources. Today it´s defaulted to full extract always.

Activity

  1. smafra commented on Dec 17, 2020

    @smafra
    Author

    Hi @rafaeljraposo,

    Thanks for the answer. Any known workarounds for that?

  2. hydriniumh2 commented on Apr 27, 2022

    @hydriniumh2

    This is an old issue, but commenting for anyone else with the same issue. It's possible to trigger the incremental refresh of a datasource, you just have to use the tasks api to run the extract rather than the datasources api

    import tableauserverclient as tsc
    import xmltodict
    
    
    personal_access_token_name = ''
    personal_access_token_secret = ''
    tableau_server = ''
    
    # Name of the data source in tableau
    datasource = ''
    
    tableau_auth = tsc.PersonalAccessTokenAuth(
        token_name=personal_access_token_name,
        personal_access_token=personal_access_token_secret
    )
    server = tsc.Server(tableau_server, use_server_version=True)
    server.auth.sign_in(tableau_auth)
    
    # Get datasource id from datasource name
    req_option = tsc.RequestOptions(pagesize=1000)
    req_option.filter.update([tsc.Filter(tsc.RequestOptions.Field.Name, tsc.RequestOptions.Operator.Equals, datasource)])
    all_datasources = list(tsc.Pager(server.datasources, req_option))
    
    datasource_id = all_datasources[0].id
    
    # Get 1000 tasks and then filter for only extract tasks under the datasource id of interest
    # I don't believe you can filter tasks
    all_extracts = list(tsc.Pager(server.tasks, tsc.RequestOptions(pagesize=1000)))
    
    # The task type for incremental extracts is 'IncrementExtractTask' and full extracts is 'extractRefresh'
    extracts = [i for i in all_extracts if (i.target.id == datasource_id) and ('IncrementExtractTask' == i.task_type)]
    
    incremental_extract_obj = extracts[0]
    
    # Trigger the incremental extract associated with the datasource
    update_xml = server.tasks.run(incremental_extract_obj)
    job_id = xmltodict.parse(update_xml)['tsResponse']['job']['@id']
    print(f"Refresh extract job {job_id} created")

    This is working on Tableau Server version 2021.4.3 with Tableau Python Server Client 0.16.0

  3. NandiniCS commented on Nov 7, 2022

    @NandiniCS

    How to do the Incremental refresh on workbooks using python script. it´s defaulted to full extract always. Do let me know.

  4. harrydevforlife commented on Nov 18, 2025

    @harrydevforlife

    Thanks @hydriniumh2, it works well.

  5. github-actions commented on Aug 6, 2026

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If this is still relevant, please comment to keep it open.

  6. jacalata commented on Aug 6, 2026

    @jacalata
    Contributor

    Closing — incremental refresh was added in PR #1545 (feat: incremental refresh for extracts). Both workbooks.refresh() and datasources.refresh() now accept an incremental=True kwarg:

    server.workbooks.refresh(workbook, incremental=True)
    server.datasources.refresh(datasource, incremental=True)
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions