Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename _simplify_graphql_response -> _simplify_response #1738

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions python-package/basedosdados/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

Expand Down Expand Up @@ -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 {}

Expand All @@ -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}"
Expand Down Expand Up @@ -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}"
Expand Down