@@ -409,7 +409,7 @@ def query_object_async(self, objectname, *, radius=3*u.arcmin, limit=5000, offse
409409 select_cols = select_cols , ** criteria )
410410
411411 @class_or_instance
412- def get_product_list_async (self , datasets , batch_size = 1000 ):
412+ def get_product_list_async (self , datasets , * , batch_size = 1000 ):
413413 """
414414 Given a dataset ID or list of dataset IDs, returns a list of associated data products.
415415
@@ -434,9 +434,8 @@ def get_product_list_async(self, datasets, batch_size=1000):
434434 if isinstance (datasets , Table ) or isinstance (datasets , Row ):
435435 dataset_kwd = self .get_dataset_kwd ()
436436 if not dataset_kwd :
437- error_msg = (f'Dataset keyword not found for mission "{ self .mission } ". '
438- 'Please input dataset IDs as a string, list of strings, or `~astropy.table.Column`.' )
439- raise InvalidQueryError (error_msg )
437+ raise InvalidQueryError (f'Dataset keyword not found for mission "{ self .mission } ". Please input '
438+ 'dataset IDs as a string, list of strings, or `~astropy.table.Column`.' )
440439
441440 # Extract dataset IDs based on input type and mission
442441 if isinstance (datasets , Table ):
@@ -472,7 +471,7 @@ def get_product_list_async(self, datasets, batch_size=1000):
472471 # Return a list of responses
473472 return results
474473
475- def get_unique_product_list (self , datasets ):
474+ def get_unique_product_list (self , datasets , * , batch_size = 1000 ):
476475 """
477476 Given a dataset ID or list of dataset IDs, returns a list of associated data products with unique
478477 filenames.
@@ -482,13 +481,16 @@ def get_unique_product_list(self, datasets):
482481 datasets : str, list, `~astropy.table.Row`, `~astropy.table.Column`, `~astropy.table.Table`
483482 Row/Table of MastMissions query results (e.g. output from `query_object`)
484483 or single/list of dataset ID(s).
484+ batch_size : int, optional
485+ Default 1000. Number of dataset IDs to include in each batch request to the server.
486+ If you experience timeouts or connection errors, consider lowering this value.
485487
486488 Returns
487489 -------
488490 unique_products : `~astropy.table.Table`
489491 Table containing products with unique URIs.
490492 """
491- products = self .get_product_list (datasets )
493+ products = self .get_product_list (datasets , batch_size = batch_size )
492494 unique_products = utils .remove_duplicate_products (products , 'filename' )
493495 if len (unique_products ) < len (products ):
494496 log .info ("To return all products, use `MastMissions.get_product_list`" )
0 commit comments