File tree Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -37,10 +37,10 @@ class SharedExportFilters(TypedDict):
3737
3838
3939class ProjectExportFilters (SharedExportFilters ):
40- batch_id : Optional [str ]
41- """ Batch id to export
40+ batch_ids : Optional [List [ str ] ]
41+ """ Batch ids to export
4242 Example:
43- >>> "clgo3lyax0000veeezdbu3ws4"
43+ >>> [ "clgo3lyax0000veeezdbu3ws4"]
4444 """
4545
4646
@@ -183,11 +183,18 @@ def _get_timezone() -> str:
183183 "type" : "data_row_id"
184184 })
185185
186- batch_id = filters .get ("batch_id" )
187- if batch_id :
186+ batch_ids = filters .get ("batch_ids" )
187+ if batch_ids :
188+ if not isinstance (batch_ids , list ):
189+ raise ValueError ("`batch_ids` filter expects a list." )
190+ if len (batch_ids ) > MAX_DATA_ROW_IDS_PER_EXPORT_V2 :
191+ raise ValueError (
192+ f"`batch_ids` filter only supports a max of { MAX_DATA_ROW_IDS_PER_EXPORT_V2 } items."
193+ )
188194 search_query .append ({
189- "ids" : [ batch_id ] ,
195+ "ids" : batch_ids ,
190196 "operator" : "is" ,
191197 "type" : "batch"
192198 })
199+
193200 return search_query
Original file line number Diff line number Diff line change @@ -442,7 +442,7 @@ def export_v2(self,
442442 "last_activity_at" : None ,
443443 "label_created_at" : None ,
444444 "data_row_ids" : None ,
445- "batch_id " : None ,
445+ "batch_ids " : None ,
446446 })
447447
448448 mutation_name = "exportDataRowsInProject"
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ def test_batch_project_export_v2(
5555 filters = {
5656 "last_activity_at" : ["2000-01-01 00:00:00" , "2050-01-01 00:00:00" ],
5757 "label_created_at" : ["2000-01-01 00:00:00" , "2050-01-01 00:00:00" ],
58- "batch_id " : batch .uid ,
58+ "batch_ids " : [ batch .uid ] ,
5959 }
6060 params = {
6161 "include_performance_details" : True ,
You can’t perform that action at this time.
0 commit comments