Skip to content

Commit 68cf9e1

Browse files
authored
feat: datetime expansion (#917)
### Description Adds support for abbreviated datetime formats (year, year-month, date) via a new `Search::normalize_datetimes()` method. This allows users to opt-in to expanding partial dates to full RFC 3339 datetime ranges - follows similar functionality to `pystac`. **Key changes:** - Implemented `expand_datetime_to_start()` and `expand_datetime_to_end()` helper functions to convert abbreviated dates to full datetime ranges - Added `Search::normalize_datetimes()` method for opt-in datetime normalization - Added two new error variants: `InvalidYear` and `UnrecognizedDateFormat` for better error handling - Comprehensive documentation and test coverage **Sidecar changes:** Bumped assert_cmd from 2.0 to 2.1 in workspace dependencies. The locked version (2.0.14) was missing the `cargo_bin_cmd!()` macro (see [docs](https://docs.rs/assert_cmd/2.0.17/assert_cmd/cargo/)), causing compilation failures in test code that relied on it ### Related issues - Closes [#463](#463) ### Checklist - [x] Unit tests - [x] Documentation, including doctests - [x] Pull request title follows [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) - [x] Pre-commit hooks pass (`prek run --all-files`)
1 parent ae73aeb commit 68cf9e1

File tree

4 files changed

+390
-1
lines changed

4 files changed

+390
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ arrow-cast = "56.0.0"
3939
arrow-json = "56.0.0"
4040
arrow-schema = "56.0.0"
4141
assert-json-diff = "2.0"
42-
assert_cmd = "2.0"
42+
assert_cmd = "2.1"
4343
async-recursion = "1.1.1"
4444
async-stream = "0.3.6"
4545
async-trait = "0.1.89"

crates/cli/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ impl Rustac {
382382
items: get_items,
383383
};
384384
let search: Search = get_search.try_into()?;
385+
let search = search.normalize_datetimes()?;
385386
let item_collection = if use_duckdb {
386387
stac_duckdb::search(href, search, *max_items)?
387388
} else {

0 commit comments

Comments
 (0)