@@ -1192,45 +1192,3 @@ def _format_failed_rows(rows: List[str],
11921192 "Timed out waiting for get_data_rows_for_global_keys job to complete."
11931193 )
11941194 time .sleep (sleep_time )
1195-
1196- def get_data_rows_for_global_keys (
1197- self ,
1198- global_keys : List [str ],
1199- timeout_seconds = 60 ) -> Dict [str , Union [str , List [Any ]]]:
1200- """
1201- Gets data rows for a list of global keys.
1202-
1203- Args:
1204- A list of global keys
1205- Returns:
1206- Dictionary containing 'status', 'results' and 'errors'.
1207-
1208- 'Status' contains the outcome of this job. It can be one of
1209- 'Success', 'Partial Success', or 'Failure'.
1210-
1211- 'Results' contains a list of `DataRow` instances successfully fetchced. It may
1212- not necessarily contain all data rows requested.
1213-
1214- 'Errors' contains a list of global_keys that could not be fetched, along
1215- with the failure reason
1216- Examples:
1217- >>> job_result = client.get_data_rows_for_global_keys(["key1","key2"])
1218- >>> print(job_result['status'])
1219- Partial Success
1220- >>> print(job_result['results'])
1221- [<DataRow ID: cl7tvvybc00icka6ggipyh8tj>, <DataRow ID: cl7tvvyfp00igka6gblrw2idc>]
1222- >>> print(job_result['errors'])
1223- [{'global_key': 'asdf', 'error': 'Data Row not found'}]
1224- """
1225- job_result = self .get_data_row_ids_for_global_keys (
1226- global_keys , timeout_seconds )
1227-
1228- # Query for data row by data_row_id to ensure we get all fields populated in DataRow instances
1229- data_rows = []
1230- for data_row_id in job_result ['results' ]:
1231- # TODO: Need to optimize this to run over a collection of data_row_ids
1232- data_rows .append (self .get_data_row (data_row_id ))
1233-
1234- job_result ['results' ] = data_rows
1235-
1236- return job_result
0 commit comments