Skip to content

Commit e70e7b0

Browse files
authored
Merge pull request #387 from NASA-IMPACT/feature/valid-stac-ingestion
feat: ingest valid stac with collection group
2 parents 9650a1b + dacbf8e commit e70e7b0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dags/veda_data_pipeline/groups/collection_group.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,16 @@ def check_collection_exists_task(ti=None):
6464
def generate_collection_task(ti=None):
6565
import json
6666
config = ti.dag_run.conf
67+
68+
# If a STAC Collection is provided, we don't need to generate generate a collection from the dataset config.
69+
# We assume the collection being passed is a valid STAC Collection and the config is validated upstream (i.e. Ingest UI)
70+
if not config.get("collection"): # Only the dataset config has a collection key
71+
return config
72+
6773
airflow_vars = Variable.get("aws_dags_variables")
6874
airflow_vars_json = json.loads(airflow_vars)
6975
role_arn = airflow_vars_json.get("ASSUME_ROLE_READ_ARN")
7076

71-
# TODO it would be ideal if this also works with complete collections where provided - this would make the collection ingest more re-usable
7277
collection = generator.generate_stac(
7378
dataset_config=config, role_arn=role_arn
7479
)

0 commit comments

Comments
 (0)