diff --git a/airflow/dags/EOSC_entity_trasform.py b/airflow/dags/EOSC_entity_trasform.py index 1bc4c9b..f4a0cb2 100644 --- a/airflow/dags/EOSC_entity_trasform.py +++ b/airflow/dags/EOSC_entity_trasform.py @@ -52,8 +52,11 @@ def trasform_product(p: dict) -> dict: filter(lambda topic: topic.get('topic').get('scheme') == 'FOS', p.get('topics'))))) p['firstPublishDate'] = next( - iter(sorted(filter(lambda date: date.get('type') == 'publishing', - [date for m in p.get('manifestations') for date in m.get('dates')]))), + iter( + sorted( + map(lambda date: date.get('value'), + filter(lambda date: date.get('type') == 'publishing', + [date for m in p.get('manifestations') for date in m.get('dates')])))), None) return p