Skip to content

Commit 8776be0

Browse files
jacalataclaude
andcommitted
Remove docs that depend on other PRs; guard the metadata example
- DatabaseItem.content_permissions: drop the value list and the claim that databases.update sends it (not true on development; the write and the LockedToDatabase value come with #1901). - Drop the explore_databases_tables.py references (sample is in #1907). - Handle empty results in the databases.populate_tables example. Co-Authored-By: Claude Code <noreply@anthropic.com>
1 parent fc1fff5 commit 8776be0

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎docs/api-ref.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2473,7 +2473,7 @@ Name | Description
24732473
`connection_type` | The connection type of the database, for example `sqlserver` or `hyper`. Read-only.
24742474
`connector_url` | The connector URL of the database. Read-only.
24752475
`contact_id` | The ID of the user who is the contact for the database. Settable; sent to the server by `databases.update`.
2476-
`content_permissions` | The permission mode of the database, as returned by the server. Must be one of `DatabaseItem.ContentPermissions.LockedToProject` (value `"LockedToDatabase"`) or `DatabaseItem.ContentPermissions.ManagedByOwner` (value `"ManagedByOwner"`). Can be set on the object, and `databases.update` sends it to the server.
2476+
`content_permissions` | The permission mode of the database, as returned by the server. `databases.update` does not send this value.
24772477
`default_table_permissions` | The default permissions for tables in the database, as a list of `PermissionsRule` objects. You must first call `databases.populate_table_default_permissions` to access this data.
24782478
`description` | The description of the database. Settable; sent to the server by `databases.update` when it is not empty.
24792479
`dqws` | The list of data quality warnings (`DQWItem`) for the database. You must first call `databases.populate_dqw` to access this data.
@@ -2687,7 +2687,7 @@ databases.populate_tables(database_item)
26872687

26882688
This method is not currently enabled. It is gated on a placeholder minimum version (`99`), so calling it raises `EndpointUnavailableError` on every Tableau Server and Tableau Cloud version. The REST API reference does not document an endpoint that lists the tables in a database.
26892689

2690-
To find the tables in a database, query the Metadata API with [metadata.query](#metadataquery) and read the matching tables with `tables.get_by_id`. The `explore_databases_tables.py` sample shows this approach.
2690+
To find the tables in a database, query the Metadata API with [metadata.query](#metadataquery) and read the matching tables with `tables.get_by_id`.
26912691

26922692
**Example**
26932693

@@ -2700,7 +2700,9 @@ query tablesInDatabase($luid: String) {
27002700
}
27012701
"""
27022702
result = server.metadata.query(query, {'luid': database.id})
2703-
for table_ref in result['data']['databases'][0]['tables']:
2703+
databases = result['data']['databases']
2704+
tables = (databases[0]['tables'] if databases else None) or []
2705+
for table_ref in tables:
27042706
table = server.tables.get_by_id(table_ref['luid'])
27052707
print(table.name)
27062708
```

‎docs/samples.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ The following list describes the samples available in the repository:
4646
* `create_project.py` Creates a project in a site.
4747
* `create_schedules.py` Creates schedules for extract refreshes and subscriptions.
4848
* `create_user.py` Creates a user on a site.
49-
* `explore_databases_tables.py` Queries databases, shows one database's details, lists its tables, then populates and lists the columns of one table. Optionally shows database and table permissions.
5049
* `explore_datasource.py` Queries datasources, selects a datasource, populates connections for the datasource, then updates the datasource.
5150
* `explore_favorites.py` Queries favorites and optionally add or delete favorites.
5251
* `explore_site.py` Interacts with sites (create, delete, and so on).

0 commit comments

Comments
 (0)