Skip to content

Commit

Permalink
fix(breadbox): client body keyword mismatch
Browse files Browse the repository at this point in the history
I think the recent pydantic upgrade changed some of the auto-generated breadbox client's parameters from `json_body` to `body`, so I am updating the facade pass in the correct parameters.
  • Loading branch information
snwessel committed Jul 22, 2024
1 parent 08b53db commit cd033af
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions breadbox-client/breadbox_facade/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def get_dataset_data(
breadbox_response = get_dataset_data_client.sync_detailed(
dataset_id=dataset_id,
client=self.client,
json_body=request_params,
body=request_params,
)
response = self._parse_client_response(breadbox_response)
try:
Expand Down Expand Up @@ -196,7 +196,7 @@ def upload_file(self, file_handle: io.BytesIO, mime_type="text/csv", chunk_size=

breadbox_response = upload_file.sync_detailed(
client=self.client,
multipart_data=BodyUploadFile(
body=BodyUploadFile(
file=File(
payload=io.BytesIO(chunk),
file_name="unnamed",
Expand Down Expand Up @@ -250,7 +250,7 @@ def add_table_dataset(
)
breadbox_response = add_dataset_uploads_client.sync_detailed(
client=self.client,
json_body=params,
body=params,
)
breadbox_response_ = typing.cast(AddDatasetResponse, self._parse_client_response(breadbox_response))
result = self.await_task_result(breadbox_response_.id, timeout=timeout)
Expand Down Expand Up @@ -294,7 +294,7 @@ def add_matrix_dataset(
)
breadbox_response = add_dataset_uploads_client.sync_detailed(
client=self.client,
json_body=params,
body=params,
)
breadbox_response_ = typing.cast(AddDatasetResponse, self._parse_client_response(breadbox_response))
result = self.await_task_result(breadbox_response_.id, timeout=timeout)
Expand Down Expand Up @@ -335,13 +335,13 @@ def add_dimension_type(self, name: str, id_column: str, axis: Union[AddDimension

params = AddDimensionType(axis=axis, id_column=id_column, name=name)

breadbox_response = add_dimension_type_client.sync_detailed(client=self.client, json_body=params)
breadbox_response = add_dimension_type_client.sync_detailed(client=self.client, body=params)
return self._parse_client_response(breadbox_response)

def update_dimension_type(self, name: str, metadata_dataset_id: str, properties_to_index: List[str]):
params = UpdateDimensionType(metadata_dataset_id, properties_to_index)

breadbox_response = update_dimension_type_client.sync_detailed(name=name, client=self.client, json_body=params)
breadbox_response = update_dimension_type_client.sync_detailed(name=name, client=self.client, body=params)
return self._parse_client_response(breadbox_response)

def get_dimension_types(self):
Expand Down Expand Up @@ -552,7 +552,7 @@ def compute_univariate_associations(
)
)
# Convert the breadbox task status response into the similar format used by the legacy portal
breadbox_response = compute_univariate_associations_client.sync_detailed(client=self.client, json_body=params)
breadbox_response = compute_univariate_associations_client.sync_detailed(client=self.client, body=params)
return self._parse_client_response(breadbox_response)

# OTHER
Expand Down

0 comments on commit cd033af

Please sign in to comment.