Skip to content

Commit f27fd9d

Browse files
committed
Document the datasources.update_data method
1 parent 147d585 commit f27fd9d

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

docs/api-ref.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,41 @@ An updated `ConnectionItem` for the data source.
748748
See the `update_connection.py` sample in the Samples directory.
749749

750750

751+
<br>
752+
<br>
753+
754+
#### datasource.update_data
755+
756+
```py
757+
datasource.update_date(datasource_or_connection_item, *, request_id, actions, payload)
758+
```
759+
760+
Updates the data contained within a published live-to-Hyper datasource.
761+
762+
REST API: [Update Data in Published Live-to-Hyper Data Sources](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_how_to_update_data_to_hyper.htm)
763+
764+
765+
**Parameters**
766+
767+
Name | Description
768+
:--- | : ---
769+
`datasource_or_connection_item` | Either a `DataSourceItem` or a `ConnectionItem`. If the datasource only contains a single connections, the `DataSourceItem` is sufficient to identify which data should be updated. Otherwise, for datasources with multiple connections, a `ConnectionItem` must be provided.
770+
`request_id` | used as an idempotency key
771+
`actions` | a list of actions (insert, update, delete, ...) specifying how to modify the data within the published datasource
772+
`payload` | an (optional) Hyper file containing tuples to be inserted/deleted or other payload data used by the `actions`.
773+
774+
For more information on the `actions`, see the [REST API docs on "Action batch description"](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_how_to_update_data_to_hyper.htm#action-batch-descriptions).
775+
To create a `payload` Hyper file, you can use [Hyper API](https://help.tableau.com/current/api/hyper_api/en-us/index.html) or [pantab](https://github.com/innobi/pantab).
776+
777+
**Returns**
778+
779+
A `JobItem` for the update job on the server. Upon completion of this job, the data was updated.
780+
781+
**Example**
782+
783+
See the `update_datasource_data.py` sample in the Samples directory.
784+
785+
751786
<br>
752787
<br>
753788

docs/samples.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,6 @@ The following list describes the samples available in the repository:
5959
* `set_http_options.py` Demonstrates HTTP options for the server and specifically for downloading workbooks.
6060
* `set_refresh_schedule.py` Sets the schedule to refresh a workbook or datasource.
6161
* `update_connection.py` Updates and embeds connection credentials of a datasource.
62+
* `update_datasource_data.py` Updates the data within a published live-to-Hyper datasource.
6263

6364
**Note**: For all of the samples, ensure that your Tableau Server user account has permission to access the resources. Also keep in mind that some example operations (like create group) are not allowed on Tableau Online.

0 commit comments

Comments
 (0)