Skip to content

Commit

Permalink
feat: add kwargs to stac-api python search (#591)
Browse files Browse the repository at this point in the history
  • Loading branch information
gadomski authored Jan 3, 2025
1 parent 94693e3 commit 35bfcd7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions crates/api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Added

- kwargs to Python search build ([#591](https://github.com/stac-utils/stac-rs/pull/591))

## [0.7.0] - 2025-01-02

### Added
Expand Down
6 changes: 5 additions & 1 deletion crates/api/src/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub fn search<'py>(
sortby: Option<StringOrList>,
filter: Option<StringOrDict<'py>>,
query: Option<Bound<'py, PyDict>>,
kwargs: Option<Bound<'py, PyDict>>,
) -> PyResult<Search> {
let mut fields = Fields::default();
if let Some(include) = include {
Expand Down Expand Up @@ -58,7 +59,7 @@ pub fn search<'py>(
.map(|filter| filter.into_cql2_json())
.transpose()
.map_err(Error::from)?;
let items = Items {
let mut items = Items {
limit,
bbox,
datetime,
Expand All @@ -68,6 +69,9 @@ pub fn search<'py>(
filter,
..Default::default()
};
if let Some(kwargs) = kwargs {
items.additional_fields = pythonize::depythonize(&kwargs)?;
}

let intersects = intersects
.map(|intersects| match intersects {
Expand Down

0 comments on commit 35bfcd7

Please sign in to comment.