Skip to content

Commit b7ce749

Browse files
authored
DOCS-3398: Add data client flutter methods to automation (#3983)
1 parent e224275 commit b7ce749

File tree

5 files changed

+1410
-40
lines changed

5 files changed

+1410
-40
lines changed

.github/workflows/sdk_protos_map.csv

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -382,47 +382,47 @@ billing,GetInvoicesSummary,,get_invoices_summary,,
382382
billing,GetInvoicePdf,,get_invoice_pdf,,
383383

384384
## Data
385-
data,GetLatestTabularData,,get_latest_tabular_data,,
386-
data,ExportTabularData,,export_tabular_data,,
387-
data,TabularDataByFilter,,tabular_data_by_filter,,
388-
data,TabularDataBySQL,,tabular_data_by_sql,,
389-
data,TabularDataByMQL,,tabular_data_by_mql,,
390-
data,BinaryDataByFilter,,binary_data_by_filter,,
391-
data,BinaryDataByIDs,,binary_data_by_ids,,
392-
data,DeleteTabularData,,delete_tabular_data,,
393-
data,DeleteBinaryDataByFilter,,delete_binary_data_by_filter,,
394-
data,DeleteBinaryDataByIDs,,delete_binary_data_by_ids,,
395-
data,AddTagsToBinaryDataByIDs,,add_tags_to_binary_data_by_ids,,
396-
data,AddTagsToBinaryDataByFilter,,add_tags_to_binary_data_by_filter,,
397-
data,RemoveTagsFromBinaryDataByIDs,,remove_tags_from_binary_data_by_ids,,
398-
data,RemoveTagsFromBinaryDataByFilter,,remove_tags_from_binary_data_by_filter,,
399-
data,TagsByFilter,,tags_by_filter,,
400-
data,AddBoundingBoxToImageByID,,add_bounding_box_to_image_by_id,,
401-
data,RemoveBoundingBoxFromImageByID,,remove_bounding_box_from_image_by_id,,
402-
data,BoundingBoxLabelsByFilter,,bounding_box_labels_by_filter,,
403-
data,GetDatabaseConnection,,get_database_connection,,
404-
data,ConfigureDatabaseUser,,configure_database_user,,
405-
data,AddBinaryDataToDatasetByIDs,,add_binary_data_to_dataset_by_ids,,
406-
data,RemoveBinaryDataFromDatasetByIDs,,remove_binary_data_from_dataset_by_ids,,
385+
data,GetLatestTabularData,,get_latest_tabular_data,,getLatestTabularData
386+
data,ExportTabularData,,export_tabular_data,,exportTabularData
387+
data,TabularDataByFilter,,tabular_data_by_filter,,tabularDataByFilter
388+
data,TabularDataBySQL,,tabular_data_by_sql,,tabularDataBySql
389+
data,TabularDataByMQL,,tabular_data_by_mql,,tabularDataByMql
390+
data,BinaryDataByFilter,,binary_data_by_filter,,binaryDataByFilter
391+
data,BinaryDataByIDs,,binary_data_by_ids,,binaryDataByIds
392+
data,DeleteTabularData,,delete_tabular_data,,deleteTabularData
393+
data,DeleteBinaryDataByFilter,,delete_binary_data_by_filter,,deleteBinaryDataByFilter
394+
data,DeleteBinaryDataByIDs,,delete_binary_data_by_ids,,deleteBinaryDataByIds
395+
data,AddTagsToBinaryDataByIDs,,add_tags_to_binary_data_by_ids,,addTagsToBinaryDataByIds
396+
data,AddTagsToBinaryDataByFilter,,add_tags_to_binary_data_by_filter,,addTagsToBinaryDataByFilter
397+
data,RemoveTagsFromBinaryDataByIDs,,remove_tags_from_binary_data_by_ids,,removeTagsFromBinaryDataByIds
398+
data,RemoveTagsFromBinaryDataByFilter,,remove_tags_from_binary_data_by_filter,,removeTagsFromBinaryDataByFilter
399+
data,TagsByFilter,,tags_by_filter,,tagsByFilter
400+
data,AddBoundingBoxToImageByID,,add_bounding_box_to_image_by_id,,addBoundingBoxToImageById
401+
data,RemoveBoundingBoxFromImageByID,,remove_bounding_box_from_image_by_id,,removeBoundingBoxFromImageById
402+
data,BoundingBoxLabelsByFilter,,bounding_box_labels_by_filter,,boundingBoxLabelsByFilter
403+
data,GetDatabaseConnection,,get_database_connection,,getDatabaseConnection
404+
data,ConfigureDatabaseUser,,configure_database_user,,configureDatabaseUser
405+
data,AddBinaryDataToDatasetByIDs,,add_binary_data_to_dataset_by_ids,,addBinaryDataToDatasetByIds
406+
data,RemoveBinaryDataFromDatasetByIDs,,remove_binary_data_from_dataset_by_ids,,removeBinaryDataFromDatasetByIds
407407

408408
## Dataset
409-
dataset,CreateDataset,,create_dataset,,
410-
dataset,DeleteDataset,,delete_dataset,,
411-
dataset,RenameDataset,,rename_dataset,,
412-
dataset,ListDatasetsByOrganizationID,,list_datasets_by_organization_id,,
409+
dataset,CreateDataset,,create_dataset,,createDataset
410+
dataset,DeleteDataset,,delete_dataset,,deleteDataset
411+
dataset,RenameDataset,,rename_dataset,,renameDataset
412+
dataset,ListDatasetsByOrganizationID,,list_datasets_by_organization_id,,listDatasetsByOrganizationID
413413
## TE: yes PySDK is singular:
414-
dataset,ListDatasetsByIDs,,list_dataset_by_ids,,
414+
dataset,ListDatasetsByIDs,,list_dataset_by_ids,,listDatasetsByIDs
415415

416416
## Datasync
417417
data_sync,DataCaptureUpload,,,,
418418
## HACK: DataCaptureUpload instead implemented in binary_data_capture_upload (python), adding pseudo-entry:
419-
data_sync,BinaryDataCaptureUpload,,binary_data_capture_upload,,
419+
data_sync,BinaryDataCaptureUpload,,binary_data_capture_upload,,binaryDataCaptureUpload
420420
## HACK: DataCaptureUpload instead implemented in tabular_data_capture_upload (python), adding pseudo-entry:
421-
data_sync,TabularDataCaptureUpload,,tabular_data_capture_upload,,
422-
data_sync,FileUpload,,file_upload,,
421+
data_sync,TabularDataCaptureUpload,,tabular_data_capture_upload,,tabularDataCaptureUpload
422+
data_sync,FileUpload,,file_upload,,uploadFile
423423
## HACK: FileUpload also implemented in file_upload_from_path (python), adding pseudo-entry:
424424
data_sync,FileUploadFromPath,,file_upload_from_path,,
425-
data_sync,StreamingDataCaptureUpload,,streaming_data_capture_upload,,
425+
data_sync,StreamingDataCaptureUpload,,streaming_data_capture_upload,,streamingDataCaptureUpload
426426

427427
## MLTraining
428428
mltraining,SubmitTrainingJob,,submit_training_job,,

.github/workflows/update_sdk_methods.py

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,10 @@
447447
"movement_sensor": "MovementSensor",
448448
"power_sensor": "PowerSensor",
449449
"vision": "VisionClient",
450-
"robot": "RobotClient"
450+
"robot": "RobotClient",
451+
"data": "DataClient",
452+
"dataset": "DataClient",
453+
"data_sync": "DataClient"
451454
}
452455

453456
## Ignore these specific APIs if they error, are deprecated, etc:
@@ -666,6 +669,7 @@ def parse(type, names):
666669
elif sdk == "flutter":
667670
flutter_methods = {}
668671
flutter_methods[type] = {}
672+
flutter_methods[type][resource] = {}
669673
if flutter_staging_url != '':
670674
scrape_url = flutter_staging_url
671675
else:
@@ -705,15 +709,32 @@ def parse(type, names):
705709
## Determine URL form for Flutter depending on type (like 'component').
706710
## TEMP: Manually exclude Base Remote Control Service (Go only):
707711
## TODO: Handle resources with 0 implemented methods for this SDK better.
708-
elif sdk == "flutter" and resource != 'base_remote_control' and resource != 'encoder' and resource != 'input_controller' \
709-
and resource != 'data_manager' and resource != 'generic_service' and resource !='mlmodel' and resource !='motion' \
710-
and resource !='navigation' and resource !='slam' and type !='app':
711-
712-
if resource in flutter_resource_overrides:
712+
elif sdk == "flutter":
713+
# Initialize Flutter methods dictionary if it doesn't exist
714+
if 'flutter' not in all_methods:
715+
all_methods['flutter'] = {}
716+
if type not in all_methods['flutter']:
717+
all_methods['flutter'][type] = {}
718+
719+
# Initialize empty dictionary for this resource
720+
all_methods['flutter'][type][resource] = {}
721+
722+
# Skip resources not supported in Flutter
723+
unsupported_resources = [
724+
"base_remote_control", "encoder", "input_controller",
725+
"data_manager", "generic_service", "mlmodel", "motion",
726+
"navigation", "slam"
727+
]
728+
if resource in unsupported_resources:
729+
if args.verbose:
730+
print(f'DEBUG: Skipping unsupported Flutter resource: {resource}')
731+
continue
732+
elif resource in flutter_resource_overrides:
713733
url = f"{scrape_url}/viam_sdk/{flutter_resource_overrides[resource]}-class.html"
734+
if args.verbose:
735+
print(f'DEBUG: Parsing Flutter URL: {url}')
714736
else:
715737
url = f"{scrape_url}/viam_sdk/{resource.capitalize()}-class.html"
716-
flutter_methods[type][resource] = {}
717738
## If an invalid language was provided:
718739
else:
719740
pass
@@ -1379,7 +1400,7 @@ def parse(type, names):
13791400
## TODO: Handle resources with 0 implemented methods for this SDK better.
13801401
elif sdk == "flutter" and resource != 'base_remote_control' and resource != 'encoder' and resource != 'input_controller' \
13811402
and resource != 'data_manager' and resource != 'generic_service' and resource !='mlmodel' and resource !='motion' \
1382-
and resource !='navigation' and resource !='slam' and type !='app':
1403+
and resource !='navigation' and resource !='slam':
13831404
soup = make_soup(url)
13841405

13851406
if resource in flutter_resource_overrides:

0 commit comments

Comments
 (0)