From 8b8c20d72f9a6b5fe8f3a8d8674809f4912f2cfe Mon Sep 17 00:00:00 2001 From: Erni Durdevic Date: Tue, 24 Oct 2023 15:23:29 +0200 Subject: [PATCH] black reformat --- examples/iterate_over_table_info.py | 43 ++++++++++++++--------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/examples/iterate_over_table_info.py b/examples/iterate_over_table_info.py index aa30db9..7813078 100644 --- a/examples/iterate_over_table_info.py +++ b/examples/iterate_over_table_info.py @@ -23,20 +23,21 @@ from discoverx.table_info import TableInfo + def my_function(table_info: TableInfo): - # TODO: Add your logic here - print(f"{table_info.catalog}.{table_info.schema}.{table_info.table} has {len(table_info.columns)} columns") - - if table_info.tags: - print(f" - catalog_tags: {table_info.tags.catalog_tags}") - print(f" - schema_tags: {table_info.tags.schema_tags}") - print(f" - table_tags: {table_info.tags.table_tags}") - print(f" - column_tags: {table_info.tags.column_tags}") + # TODO: Add your logic here + print(f"{table_info.catalog}.{table_info.schema}.{table_info.table} has {len(table_info.columns)} columns") + + if table_info.tags: + print(f" - catalog_tags: {table_info.tags.catalog_tags}") + print(f" - schema_tags: {table_info.tags.schema_tags}") + print(f" - table_tags: {table_info.tags.table_tags}") + print(f" - column_tags: {table_info.tags.column_tags}") + + # The returned objects will be concatenated in the map result + return table_info - # The returned objects will be concatenated in the map result - return table_info - # COMMAND ---------- @@ -45,10 +46,10 @@ def my_function(table_info: TableInfo): # COMMAND ---------- -result = (dx - .from_tables(from_tables) - .with_concurrency(1) # You can increase the concurrency with this parameter - .map(my_function) +result = ( + dx.from_tables(from_tables) + .with_concurrency(1) # You can increase the concurrency with this parameter + .map(my_function) ) # COMMAND ---------- @@ -62,11 +63,11 @@ def my_function(table_info: TableInfo): # COMMAND ---------- -result = (dx - .from_tables(from_tables) - .with_concurrency(1) # You can increase the concurrency with this parameter - .with_tags() # This will ensure we add tag information to the table info - .map(my_function) +result = ( + dx.from_tables(from_tables) + .with_concurrency(1) # You can increase the concurrency with this parameter + .with_tags() # This will ensure we add tag information to the table info + .map(my_function) ) # COMMAND ---------- @@ -74,5 +75,3 @@ def my_function(table_info: TableInfo): len(result) # COMMAND ---------- - -