106
106
StreamingDataCaptureUploadResponse ,
107
107
UploadMetadata ,
108
108
)
109
- from viam .utils import ValueTypes , _alias_param , create_filter , datetime_to_timestamp , struct_to_dict , dict_to_struct
109
+ from viam .utils import ValueTypes , _alias_param , create_filter , datetime_to_timestamp , dict_to_struct , struct_to_dict
110
110
111
111
LOGGER = logging .getLogger (__name__ )
112
112
@@ -536,7 +536,12 @@ async def tabular_data_by_mql(
536
536
537
537
@_alias_param ("resource_api" , param_alias = "resource_subtype" )
538
538
async def get_latest_tabular_data (
539
- self , part_id : str , resource_name : str , resource_api : str , method_name : str , additional_params : Optional [Mapping [str , ValueTypes ]] = None ,
539
+ self ,
540
+ part_id : str ,
541
+ resource_name : str ,
542
+ resource_api : str ,
543
+ method_name : str ,
544
+ additional_params : Optional [Mapping [str , ValueTypes ]] = None ,
540
545
) -> Optional [Tuple [datetime , datetime , Dict [str , ValueTypes ]]]:
541
546
"""Gets the most recent tabular data captured from the specified data source, as long as it was synced within the last year.
542
547
@@ -579,8 +584,11 @@ async def get_latest_tabular_data(
579
584
"""
580
585
581
586
request = GetLatestTabularDataRequest (
582
- part_id = part_id , resource_name = resource_name , resource_subtype = resource_api , method_name = method_name ,
583
- additional_parameters = dict_to_struct (additional_params )
587
+ part_id = part_id ,
588
+ resource_name = resource_name ,
589
+ resource_subtype = resource_api ,
590
+ method_name = method_name ,
591
+ additional_parameters = dict_to_struct (additional_params ),
584
592
)
585
593
response : GetLatestTabularDataResponse = await self ._data_client .GetLatestTabularData (request , metadata = self ._metadata )
586
594
if not response .payload :
@@ -596,7 +604,7 @@ async def export_tabular_data(
596
604
method_name : str ,
597
605
start_time : Optional [datetime ] = None ,
598
606
end_time : Optional [datetime ] = None ,
599
- additional_params : Optional [Mapping [str , ValueTypes ]] = None ,
607
+ additional_params : Optional [Mapping [str , ValueTypes ]] = None ,
600
608
) -> List [TabularDataPoint ]:
601
609
"""Obtain unified tabular data and metadata from the specified data source.
602
610
@@ -631,8 +639,12 @@ async def export_tabular_data(
631
639
632
640
interval = CaptureInterval (start = datetime_to_timestamp (start_time ), end = datetime_to_timestamp (end_time ))
633
641
request = ExportTabularDataRequest (
634
- part_id = part_id , resource_name = resource_name , resource_subtype = resource_api , method_name = method_name , interval = interval ,
635
- additional_parameters = dict_to_struct (additional_params )
642
+ part_id = part_id ,
643
+ resource_name = resource_name ,
644
+ resource_subtype = resource_api ,
645
+ method_name = method_name ,
646
+ interval = interval ,
647
+ additional_parameters = dict_to_struct (additional_params ),
636
648
)
637
649
response : List [ExportTabularDataResponse ] = await self ._data_client .ExportTabularData (request , metadata = self ._metadata )
638
650
0 commit comments