File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -235,12 +235,20 @@ def get_document_url(self, rp_story_id):
235235 return response .json ()['url' ]
236236
237237 def get_flatfile_list (self , flatfile_type ):
238- assert flatfile_type in {
239- 'companies' , 'full'
240- }
238+ self ._assert_flatfile_type_is_valid (flatfile_type )
241239 response = self .request ('/history/%s' % flatfile_type )
242240 return response .json ()
243241
242+ def _assert_flatfile_type_is_valid (self , flatfile_type ):
243+ if self .product == "rpa" :
244+ if flatfile_type in {"companies" , "full" }:
245+ return
246+ else :
247+ # In Edge we have too many different types to hardcode them here.
248+ return
249+ raise ValueError (f"Flatfile type { flatfile_type } is not valid for product { self .product } " )
250+
251+
244252 def get_flatfile (self , flatfile_type , flatfile_id ):
245253 """ Request the flatfile and return a streammable response """
246254 return self .request (
You can’t perform that action at this time.
0 commit comments