Skip to content

Commit 50345ec

Browse files
lacoak21greglucas
andauthored
supply repointing number to first call to upstream dependenceis (#961)
Co-authored-by: Greg Lucas <greg.m.lucas@gmail.com>
1 parent 5d8649c commit 50345ec

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

sds_data_manager/lambda_code/SDSCode/pipeline_lambdas/batch_starter.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ def submit_all_jobs(
381381
job_node,
382382
trigger_start_date,
383383
trigger_end_date,
384+
repoint: Optional[int] = None,
384385
calculate_crids=False,
385386
filter_dependencies=True,
386387
):
@@ -398,6 +399,8 @@ def submit_all_jobs(
398399
determines the range of potential jobs.
399400
trigger_end_date : str
400401
The end date of the file that triggered the job in the format 'YYYYMMDD'.
402+
repoint : int, optional
403+
The repointing number for the job. Default is None.
401404
calculate_crids : bool
402405
True if the file that triggered the job is a science file, False if it is SPICE
403406
or ancillary.
@@ -429,6 +432,7 @@ def submit_all_jobs(
429432
relationship="ALL",
430433
start_date=trigger_start_date,
431434
end_date=trigger_end_date,
435+
repoint=repoint,
432436
calculate_crids=calculate_crids,
433437
get_spice=get_spice,
434438
)
@@ -792,11 +796,16 @@ def s3_processing_event(session, events):
792796
if isinstance(file_obj, AncillaryFilePath):
793797
filter_dependencies = True
794798

799+
# Pass along the repointing number if the file is a science file.
800+
repoint = (
801+
file_obj.repointing if isinstance(file_obj, ScienceFilePath) else None
802+
)
795803
submit_all_jobs(
796804
session,
797805
job,
798806
trigger_start_time,
799807
trigger_end_time,
808+
repoint,
800809
calculate_crids,
801810
filter_dependencies,
802811
)

tests/lambda_endpoints/test_batch_starter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,6 +1642,7 @@ def test_repoint_date_range(sqs_mock, mock_download, session, s3_client, tmp_pat
16421642
start_date=datetime(2000, 2, 24),
16431643
version="v001",
16441644
extension="pkts",
1645+
repointing=47,
16451646
ingestion_date=datetime.strptime(
16461647
"2024-01-25 23:35:26+00:00", "%Y-%m-%d %H:%M:%S%z"
16471648
),

0 commit comments

Comments
 (0)