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

RSDK-9146: Change Python TabularDataBySQL/MQL return type to raw BSON #774

Merged
merged 11 commits into from
Nov 1, 2024

Conversation

jckras
Copy link
Member

@jckras jckras commented Oct 25, 2024

For context: The return type of the TabularDataBySQL/MQL proto has changed to return both a list of structs, the existing return type, and also a list of bytearrays that represent BSON.

  • Added a required dependency to pymongo to use the BSON library
  • BSON provides a decode() function for converting lists of byte sequences into Python dictionaries.

Testing:

  • I ensured that date fields are returned as native Python datetime objects instead of strings by running tabular_data_by_mql against real tabular data on viam-dev and printed the decoded data and their types:
    Screenshot 2024-10-29 at 11 56 09 AM
  • Updated the TABULAR_QUERY_RESPONSE testing data to include datetime objects, as the Python SDK will receive date fields in this format.

@jckras jckras marked this pull request as ready for review October 25, 2024 15:45
@jckras jckras requested a review from a team as a code owner October 25, 2024 15:45
@jckras jckras requested review from stuqdog, purplenicole730 and lia-viam and removed request for purplenicole730 October 25, 2024 15:45
@jckras jckras changed the title RSDK-8908: Change TabularDataBySQL/MQL return type to raw BSON RSDK-9146: Change TabularDataBySQL/MQL return type to raw BSON Oct 25, 2024
@jckras jckras changed the title RSDK-9146: Change TabularDataBySQL/MQL return type to raw BSON RSDK-9146: Change Python TabularDataBySQL/MQL return type to raw BSON Oct 28, 2024
@jckras jckras marked this pull request as draft October 28, 2024 20:07
@jckras jckras marked this pull request as ready for review October 28, 2024 20:58
@jckras jckras marked this pull request as draft October 29, 2024 15:33
@jckras jckras marked this pull request as ready for review October 29, 2024 16:22
Copy link
Member

@njooma njooma left a comment

Choose a reason for hiding this comment

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

nearly there! only one change

pyproject.toml Outdated Show resolved Hide resolved
@jckras jckras requested a review from njooma October 30, 2024 19:47
@jckras jckras merged commit e0cec71 into viamrobotics:main Nov 1, 2024
12 checks passed
@jckras jckras deleted the bson branch November 1, 2024 16:23
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