Skip to content

Conversation

@PatrickfBraz
Copy link
Contributor

Context

I am using the client to ingest Tableau metadata into the metadata platform called DataHub. When searching for metadata via GraphQL query, the client is returning the error shown in the message below. From my understanding of the code, this error can happen in 2 moments: at the end of pagination or at the beginning. In any case, the non-existence of the key sought within the json will cause extract_values to return an empty list and therefore trigger the IndexError when trying to call the pop method.

Traceback

line 713, in get_connection_objects
pages = self.tableau_source.server.metadata.paginated_query(query, variables=variables)["pages"] # type: ignore
File "/usr/local/lib/python3.10/site-packages/tableauserverclient/server/endpoint/endpoint.py", line 205, in wrapper
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/tableauserverclient/server/endpoint/metadata_endpoint.py", line 125, in paginated_query
has_another_page, cursor = get_page_info(results)
File "/usr/local/lib/python3.10/site-packages/tableauserverclient/server/endpoint/metadata_endpoint.py", line 45, in get_page_info
next_page = extract_values(result, "hasNextPage").pop()
IndexError: pop from empty list

Aditional information

The query we try to execute through the method client.server.metadata.paginated_query(...) is the following:

query customSQLDatasources($first: Int, $afterToken: String, $datasource_ids: [ID]){customSQLTablesConnection(first: $first, after: $afterToken, filter:{idWithin: $datasource_ids}){nodes{id name query columns{id name remoteType description referencedByFields{datasource{__typename id name upstreamTables{id name isEmbedded database{name } schema fullName connectionType } ... on PublishedDatasource{projectName luid } ... on EmbeddedDatasource{workbook{id name projectName luid } } } } } tables{id name isEmbedded database{name } schema fullName connectionType description columns{name remoteType } } database{name connectionType } } pageInfo{hasNextPage endCursor } totalCount } } 

dependabotbotand others added 4 commits June 17, 2024 22:23
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.0.7 to 2.2.2. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](urllib3/urllib3@2.0.7...2.2.2) --- updated-dependencies: - dependency-name: urllib3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]>
@salesforce-cla
Copy link

Thanks for the contribution! Before we can merge this, we need @PatrickfBraz to sign the Salesforce Inc. Contributor License Agreement.

@PatrickfBraz
Copy link
ContributorAuthor

Signed
image

@jacalatajacalata changed the base branch from master to developmentJune 21, 2024 05:35
@jacalatajacalata merged commit 84f2af4 into tableau:developmentJul 26, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@PatrickfBraz@jacalata