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

[DATA-2034] Add file extensions to binary data capture upload #466

Merged
merged 3 commits into from
Oct 19, 2023

Conversation

njooma
Copy link
Member

@njooma njooma commented Oct 17, 2023

Add ability to provide file_extension to binary data capture upload

Copy link
Contributor

@jeremyrhyde jeremyrhyde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this, the file extension will help us upload pcds, but does it also get translated to mime_type? The current issue we are facing is that the replay camera filters for objects with a mime_type of pcd

@@ -437,6 +437,7 @@ async def binary_data_capture_upload(
method_parameters: Optional[Mapping[str, Any]] = None,
tags: Optional[List[str]] = None,
data_request_times: Optional[Tuple[datetime, datetime]] = None,
file_extension: Optional[str] = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can/does the file extension get translated to mime_type in the cloud?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to @agreenb, yes

... which we convert to mime type in the backend

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! here and here, which uses a .pcd file extension to get the point cloud mime type.

Copy link
Contributor

@agreenb agreenb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the lightning fast fix and supporting if the user doesn't provide a prepended period!

@@ -437,6 +437,7 @@ async def binary_data_capture_upload(
method_parameters: Optional[Mapping[str, Any]] = None,
tags: Optional[List[str]] = None,
data_request_times: Optional[Tuple[datetime, datetime]] = None,
file_extension: Optional[str] = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! here and here, which uses a .pcd file extension to get the point cloud mime type.

@@ -453,6 +454,7 @@ async def binary_data_capture_upload(
tags (Optional[List[str]]): Optional list of tags to allow for tag-based data filtering when retrieving data.
data_request_times (Optional[Tuple[datetime.datetime, datetime.datetime]]): Optional tuple containing `datetime`s objects
denoting the times this data was requested[0] by the robot and received[1] from the appropriate sensor.
file_extension (str): The file extension of binary data including the period, e.g. .jpg, .png, .pcd
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you include that this routes the file to its corresponding mime type in the backend?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agreenb how's this for text:

The backend will route the binary to its corresponding mime type based on this extension.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks!

@njooma njooma merged commit 57ec5eb into viamrobotics:main Oct 19, 2023
10 checks passed
@njooma njooma deleted the DATA-2034/file-ext branch October 19, 2023 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants