Skip to content

Commit 2897792

Browse files
Merge pull request #397 from OP-TED/feature/TED-1047
Update notice_fetch_by_date_workflow.py
2 parents da88262 + e1cfaba commit 2897792

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

dags/notice_fetch_by_date_workflow.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from datetime import timedelta
2+
13
from airflow.decorators import dag, task
24
from airflow.operators.dummy import DummyOperator
35
from airflow.operators.python import BranchPythonOperator, PythonOperator
@@ -58,7 +60,9 @@ def validate_fetched_notices():
5860
from datetime import datetime
5961
from pymongo import MongoClient
6062

61-
publication_date = datetime.strptime(get_dag_param(key=WILD_CARD_DAG_KEY), "%Y%m%d*")
63+
publication_date = datetime.strptime(get_dag_param(key=WILD_CARD_DAG_KEY,
64+
default_value=(datetime.now() - timedelta(days=1)).strftime(
65+
"%Y%m%d*")), "%Y%m%d*")
6266
mongodb_client = MongoClient(config.MONGO_DB_AUTH_URL)
6367
validate_and_update_daily_supra_notice(notice_publication_day=publication_date,
6468
mongodb_client=mongodb_client)

tests/features/notice_publisher/test_notice_publisher_s3.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def the_notice_mets_manifestation_publication_is_executed(publish_eligible_notic
4848
publish_result = publish_notice_into_s3(notice=publish_eligible_notice, s3_publisher=s3_publisher,
4949
bucket_name=s3_bucket_name)
5050
assert publish_result
51+
publish_eligible_notice.update_status_to(new_status=NoticeStatus.PUBLISHED)
5152
return publish_eligible_notice
5253

5354

0 commit comments

Comments
 (0)