Skip to content

Commit

Permalink
feat(tableau): use pagination for all connection queries
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurinehate committed Jun 20, 2022
1 parent 0ee2569 commit aa6fef6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions metadata-ingestion/src/datahub/ingestion/source/tableau.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ class TableauConfig(ConfigModel):

workbooks_page_size: int = Field(
default=10,
description="Number of workbooks to query at a time using Tableau api.",
description="Number of metadata objects (e.g. workbooks, etc) to query at a time using Tableau api.",
)

env: str = Field(
default=builder.DEFAULT_ENV,
description="Environment to use in namespace when constructing URNs.",
Expand Down Expand Up @@ -247,6 +248,9 @@ def get_connection_object(
count: int = 0,
current_count: int = 0,
) -> Tuple[dict, int, int]:
logger.debug(
f"Query {connection_type} to get {count} objects with offset {current_count}"
)
query_data = query_metadata(
self.server, query, connection_type, count, current_count, query_filter
)
Expand Down Expand Up @@ -410,7 +414,7 @@ def _create_upstream_table_lineage(
return upstream_tables

def emit_custom_sql_datasources(self) -> Iterable[MetadataWorkUnit]:
count_on_query = len(self.custom_sql_ids_being_used)
count_on_query = self.config.workbooks_page_size
custom_sql_filter = "idWithin: {}".format(
json.dumps(self.custom_sql_ids_being_used)
)
Expand Down Expand Up @@ -779,7 +783,7 @@ def emit_datasource(
)

def emit_published_datasources(self) -> Iterable[MetadataWorkUnit]:
count_on_query = len(self.datasource_ids_being_used)
count_on_query = self.config.workbooks_page_size
datasource_filter = "idWithin: {}".format(
json.dumps(self.datasource_ids_being_used)
)
Expand Down

0 comments on commit aa6fef6

Please sign in to comment.