@@ -351,7 +351,7 @@ def _execute(self, logger: logging.Logger, env_config: EnvConfig, rai_config: Ra
351
351
def await_pending (self , env_config , logger , missed_resources ):
352
352
loop = asyncio .get_event_loop ()
353
353
if loop .is_running ():
354
- raise Exception ('Waiting for resource would interrupt unexpected event loop - aborting to avoid confusion. ' )
354
+ raise Exception ('Waiting for resource would interrupt unexpected event loop - aborting to avoid confusion' )
355
355
pending = [src for src in missed_resources if self ._resource_is_async (src )]
356
356
pending_cos = [self ._await_async_resource (logger , env_config , resource ) for resource in pending ]
357
357
loop .run_until_complete (asyncio .gather (* pending_cos ))
@@ -365,28 +365,35 @@ async def _await_async_resource(self, logger: logging.Logger, env_config: EnvCon
365
365
def _load_source (self , logger : logging .Logger , env_config : EnvConfig , rai_config : RaiConfig , src ):
366
366
source_name = src ["source" ]
367
367
if 'is_date_partitioned' in src and src ['is_date_partitioned' ] == 'Y' :
368
+ logger .info (f"Loading source '{ source_name } ' partitioned by date" )
368
369
if self .collapse_partitions_on_load :
369
370
srcs = src ["dates" ]
370
371
first_date = srcs [0 ]["date" ]
371
372
last_date = srcs [- 1 ]["date" ]
372
373
373
374
logger .info (
374
- f"Loading '{ source_name } ' from all partitions simultaneously, range { first_date } to { last_date } " )
375
+ f"Loading '{ source_name } ' all date partitions simultaneously, range { first_date } to { last_date } " )
375
376
376
377
resources = []
377
378
for d in srcs :
378
379
resources += d ["resources" ]
379
380
self ._load_resource (logger , env_config , rai_config , resources , src )
380
381
else :
381
- logger .info (f"Loading '{ source_name } ' one partition at a time" )
382
+ logger .info (f"Loading '{ source_name } ' one date partition at a time" )
382
383
for d in src ["dates" ]:
383
384
logger .info (f"Loading partition for date { d ['date' ]} " )
384
385
385
- resources = d ["resources" ]
386
- self ._load_resource (logger , env_config , rai_config , resources , src )
386
+ for res in d ["resources" ]:
387
+ self ._load_resource (logger , env_config , rai_config , [ res ] , src )
387
388
else :
388
- logger .info (f"Loading source '{ source_name } ' not partitioned by date " )
389
- self ._load_resource (logger , env_config , rai_config , src ["resources" ], src )
389
+ logger .info (f"Loading source '{ source_name } ' not partitioned by date" )
390
+ if self .collapse_partitions_on_load :
391
+ logger .info (f"Loading '{ source_name } ' all chunk partitions simultaneously" )
392
+ self ._load_resource (logger , env_config , rai_config , src ["resources" ], src )
393
+ else :
394
+ logger .info (f"Loading '{ source_name } ' one chunk partition at a time" )
395
+ for res in src ["resources" ]:
396
+ self ._load_resource (logger , env_config , rai_config , [res ], src )
390
397
391
398
@staticmethod
392
399
def _resource_is_async (src ):
@@ -539,7 +546,7 @@ def _load_exports(logger: logging.Logger, env_config: EnvConfig, src) -> List[Ex
539
546
container = env_config .get_container (e .get ("container" , default_container )),
540
547
offset_by_number_of_days = e .get ("offsetByNumberOfDays" , 0 )))
541
548
except KeyError as ex :
542
- logger .warning (f"Unsupported FileType: { ex } . Skipping export: { e } . " )
549
+ logger .warning (f"Unsupported FileType: { ex } . Skipping export: { e } " )
543
550
return exports
544
551
545
552
0 commit comments