Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: set default current-date for collection_from_items script TDE-1298 #1196

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions scripts/collection_from_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import json
import os
from argparse import Namespace
from datetime import datetime, timezone
from typing import TYPE_CHECKING, List

import shapely.geometry
Expand All @@ -10,7 +11,7 @@
from linz_logger import get_log

from scripts.cli.cli_helper import coalesce_multi_single, str_to_gsd
from scripts.datetimes import parse_rfc_3339_datetime
from scripts.datetimes import RFC_3339_DATETIME_FORMAT, parse_rfc_3339_datetime
from scripts.files.files_helper import SUFFIX_FOOTPRINT, SUFFIX_JSON
from scripts.files.fs_s3 import bucket_name_from_path, get_object_parallel_multithreading, list_files_in_uri
from scripts.logging.time_helper import time_in_ms
Expand Down Expand Up @@ -114,10 +115,11 @@ def parse_args(args: List[str] | None) -> Namespace:
"--current-datetime",
dest="current_datetime",
help=(
"The datetime that is used as current datetime in the metadata. "
"The datetime to be used as current datetime in the metadata. "
"Format: RFC 3339 UTC datetime, `YYYY-MM-DDThh:mm:ssZ`."
),
required=True,
required=False,
default=datetime.now(timezone.utc).strftime(RFC_3339_DATETIME_FORMAT),
)

return parser.parse_args(args)
Expand Down
2 changes: 0 additions & 2 deletions scripts/tests/collection_from_items_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ def test_should_create_collection_file(item: ImageryItem, fake_linz_slug: str) -
"Placeholder",
"--concurrency",
"25",
"--current-datetime",
any_epoch_datetime_string(),
"--linz-slug",
fake_linz_slug,
]
Expand Down