diff --git a/python-package/basedosdados/backend.py b/python-package/basedosdados/backend.py index c5bb8429c..801f85136 100644 --- a/python-package/basedosdados/backend.py +++ b/python-package/basedosdados/backend.py @@ -291,7 +291,7 @@ def get_dataset_config(self, dataset_id: str) -> Dict[str, Any]: if dataset_id: variables = {"dataset_id": dataset_id} response = self._execute_query(query=query, variables=variables) - return self._simplify_graphql_response(response).get("allDataset")[0] + return self._simplify_response(response).get("allDataset")[0] else: return {} @@ -345,7 +345,7 @@ def get_table_config(self, dataset_id: str, table_id: str) -> Dict[str, Any]: if table_id: variables = {"table_id": table_id} response = self._execute_query(query=query, variables=variables) - return self._simplify_graphql_response(response).get("allTable")[0] + return self._simplify_response(response).get("allTable")[0] else: return {} @@ -368,7 +368,7 @@ def _get_dataset_id_from_name(self, gcp_dataset_id): variables = {"gcp_dataset_id": gcp_dataset_id} response = self._execute_query(query=query, variables=variables) - r = {} if response is None else self._simplify_graphql_response(response) + r = {} if response is None else self._simplify_response(response) if r.get("allCloudtable", []) != []: return r.get("allCloudtable")[0].get("table").get("dataset").get("_id") msg = f"{gcp_dataset_id} not found. Please create the metadata first in {self.graphql_url}" @@ -397,7 +397,7 @@ def _get_table_id_from_name(self, gcp_dataset_id, gcp_table_id): } response = self._execute_query(query=query, variables=variables) - r = {} if response is None else self._simplify_graphql_response(response) + r = {} if response is None else self._simplify_response(response) if r.get("allCloudtable", []) != []: return r.get("allCloudtable")[0].get("table").get("_id") msg = f"No table {gcp_table_id} found in {gcp_dataset_id}. Please create in {self.graphql_url}"