Skip to content

Commit

Permalink
feat: formatting done
Browse files Browse the repository at this point in the history
  • Loading branch information
aytekin-smartcar committed May 2, 2024
1 parent d045521 commit 8885c3c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions smartcar/vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,9 @@ def batch(self, paths: List[str]) -> namedtuple:
"sc-request-id"
)
# use lambda default args to avoid issues with closures
batch_dict[
attribute
] = lambda p=path, r=res_dict: types.select_named_tuple(p, r)
batch_dict[attribute] = (
lambda p=path, r=res_dict: types.select_named_tuple(p, r)
)
else:
# if individual response is erroneous, attach a lambda that returns a SmartcarException
def _attribute_raise_exception(smartcar_exception):
Expand All @@ -455,9 +455,9 @@ def _attribute_raise_exception(smartcar_exception):
headers = response.headers
body = json.dumps(res_dict.get("body"))
sc_exception = sce.exception_factory(code, headers, body)
batch_dict[
attribute
] = lambda e=sc_exception: _attribute_raise_exception(e)
batch_dict[attribute] = (
lambda e=sc_exception: _attribute_raise_exception(e)
)

# STEP 3 - Attach Meta to batch_dict
batch_dict["meta"] = types.build_meta(response.headers)
Expand Down

0 comments on commit 8885c3c

Please sign in to comment.