Skip to content

Commit

Permalink
Bump version to 0.35.0
Browse files Browse the repository at this point in the history
  • Loading branch information
purplenicole730 committed Dec 9, 2024
1 parent 8c542ee commit b20cff4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
10 changes: 7 additions & 3 deletions src/viam/app/data_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ async def tabular_data_by_mql(self, organization_id: str, mql_binary: List[bytes
response: TabularDataByMQLResponse = await self._data_client.TabularDataByMQL(request, metadata=self._metadata)
return [bson.decode(bson_bytes) for bson_bytes in response.raw_data]

async def get_latest_tabular_data(self, part_id: str, resource_name: str, resource_subtype: str, method_name: str) -> Optional[Tuple[datetime, datetime, Dict[str, ValueTypes]]]:
async def get_latest_tabular_data(
self, part_id: str, resource_name: str, resource_subtype: str, method_name: str
) -> Optional[Tuple[datetime, datetime, Dict[str, ValueTypes]]]:
"""Gets the most recent tabular data captured from the specified data source, as long as it was synced within the last year.
::
Expand Down Expand Up @@ -328,11 +330,13 @@ async def get_latest_tabular_data(self, part_id: str, resource_name: str, resour
For more information, see `Data Client API <https://docs.viam.com/appendix/apis/data-client/>`_.
"""

request = GetLatestTabularDataRequest(part_id=part_id, resource_name=resource_name, resource_subtype=resource_subtype, method_name=method_name)
request = GetLatestTabularDataRequest(
part_id=part_id, resource_name=resource_name, resource_subtype=resource_subtype, method_name=method_name
)
response: GetLatestTabularDataResponse = await self._data_client.GetLatestTabularData(request, metadata=self._metadata)
if not response.payload:
return None
return response.time_captured.ToDatetime(), response.time_synced.ToDatetime(), struct_to_dict(response.payload)
return response.time_captured.ToDatetime(), response.time_synced.ToDatetime(), struct_to_dict(response.payload)

async def binary_data_by_filter(
self,
Expand Down
2 changes: 1 addition & 1 deletion src/viam/version_metadata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.34.0"
__version__ = "0.35.0"

API_VERSION = "v0.1.367"
SDK_VERSION = __version__
3 changes: 2 additions & 1 deletion tests/mocks/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,9 +1011,10 @@ async def GetLatestTabularData(self, stream: Stream[GetLatestTabularDataRequest,
self.resource_subtype = request.resource_subtype
self.method_name = request.method_name
timestamp = datetime_to_timestamp(datetime(2024, 12, 25))
data=dict_to_struct(self.tabular_response[0].data)
data = dict_to_struct(self.tabular_response[0].data)
await stream.send_message(GetLatestTabularDataResponse(time_captured=timestamp, time_synced=timestamp, payload=data))


class MockDataset(DatasetServiceBase):
def __init__(self, create_response: str, datasets_response: Sequence[Dataset]):
self.create_response = create_response
Expand Down

0 comments on commit b20cff4

Please sign in to comment.