From 683f8beef386ab48cada3ea140f2fea8553acc5e Mon Sep 17 00:00:00 2001 From: Vinicius Aguiar Date: Thu, 14 Sep 2023 21:48:49 -0300 Subject: [PATCH] fix: add number of columns to table metadata action (#390) --- basedosdados_api/api/v1/admin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/basedosdados_api/api/v1/admin.py b/basedosdados_api/api/v1/admin.py index 61f84850..edba9e89 100644 --- a/basedosdados_api/api/v1/admin.py +++ b/basedosdados_api/api/v1/admin.py @@ -244,6 +244,7 @@ def update_table_metadata(modeladmin, request, queryset: QuerySet): try: bq_table = client.get_table(table.db_slug) table.number_rows = bq_table.num_rows or None + table.number_columns = len(bq_table.schema) or None table.compressed_file_size = bq_table.num_bytes or None table.uncompressed_file_size = bq_table.num_bytes or None table.save()