File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -760,6 +760,7 @@ def get_entities_from_osw(
760760    model_to_cast_to ,
761761    cred_filepath ,
762762    domain ,
763+     limit : int  =  None ,
763764    osw_obj : OSW  =  None ,
764765    debug : bool  =  False ,
765766) ->  list :
@@ -777,6 +778,8 @@ def get_entities_from_osw(
777778        Filepath to the credentials file, used to access the OSW instance. 
778779    domain: 
779780        Domain of the OSW instance. 
781+     limit: 
782+         Maximum number of entities returned by this query 
780783    osw_obj: 
781784        OSW instance to use. If None, a new instance is created. 
782785    debug: 
@@ -810,9 +813,17 @@ def test_if_empty_list_or_none(obj) -> bool:
810813    if  debug :
811814        print (f"Searching for instances of { category_to_search }  )
812815    entities  =  wtsite_obj .semantic_search (
813-         query = wt .SearchParam (
814-             query = f"[[HasType::Category:OSW{ str (category_uuid ).replace ('-' , '' )}  ,
815-             debug = debug ,
816+         query = (
817+             wt .SearchParam (
818+                 query = f"[[HasType::Category:OSW{ str (category_uuid ).replace ('-' , '' )}  ,
819+                 debug = debug ,
820+             )
821+             if  limit  is  None 
822+             else  wt .SearchParam (
823+                 query = f"[[HasType::Category:OSW{ str (category_uuid ).replace ('-' , '' )}  ,
824+                 debug = debug ,
825+                 limit = limit ,
826+             )
816827        )
817828    )
818829    for  entity  in  entities :
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments