Skip to content

Commit

Permalink
style(utility): update error message for calling "get_callback_body"
Browse files Browse the repository at this point in the history
PR Closed: #1246
  • Loading branch information
zhen.chen committed Apr 11, 2022
1 parent 526a7e9 commit 9d5e031
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tensorbay/client/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ def upload_frame(self, frame: Frame, timestamp: Optional[float] = None) -> None:
callback_bodies = []
for sensor_name, data in frame.items():
try:
callback_body = data.get_callback_body() # type:ignore[union-attr]
callback_body = data.get_callback_body()
except AttributeError:
continue

Expand Down
9 changes: 9 additions & 0 deletions tensorbay/utility/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,12 @@ def open(self) -> Union[UserResponse, BufferedReader]:
self._write_cache(cache_path)

return open(cache_path, "rb")

def get_callback_body(self) -> Dict[str, Any]:
"""Not support ``get_callback_body`` function.
Raises:
AttributeError: when calling the ``get_callback_body()``.
"""
raise AttributeError(f"Could not dump a '{self.__class__.__name__}' instance")

0 comments on commit 9d5e031

Please sign in to comment.