Skip to content

Support STAC items without bbox #639

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

Merged
merged 1 commit into from
Mar 25, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
__pycache__/
.ipynb_checkpoints/
/.venv
/node_modules/
38 changes: 13 additions & 25 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,12 @@ repos:
language: system
types: [python]
require_serial: true
- id: check-added-large-files
name: Check for added large files
entry: check-added-large-files
language: system
- id: check-toml
name: Check Toml
entry: check-toml
language: system
types: [toml]
- id: check-yaml
name: Check Yaml
entry: check-yaml
language: system
types: [yaml]
- id: darglint
name: darglint
entry: darglint
language: system
types: [python]
stages: [manual]
- id: end-of-file-fixer
name: Fix End of Files
entry: end-of-file-fixer
language: system
types: [text]
stages: [commit, push, manual]
- id: flake8
name: flake8
entry: flake8
Expand All @@ -54,14 +34,22 @@ repos:
language: system
types: [python]
args: [--py37-plus]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-toml
types: [toml]
- id: check-yaml
types: [yaml]
- id: end-of-file-fixer
types: [text]
stages: [pre-commit, pre-push, manual]
- id: trailing-whitespace
name: Trim Trailing Whitespace
entry: trailing-whitespace-fixer
language: system
types: [text]
stages: [commit, push, manual]
stages: [pre-commit, pre-push, manual]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.6.0
rev: v3.1.0
hooks:
- id: prettier
# - repo: https://github.com/pre-commit/mirrors-mypy
Expand Down
8 changes: 5 additions & 3 deletions src/stac_api_validator/validations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3235,12 +3235,13 @@ def _validate_search_ids_with_ids_no_override(
errors: Errors,
r_session: Session,
) -> None:
bbox = item["bbox"]
bbox = item.get("bbox")
get_params = {
"ids": item["id"],
"collections": item["collection"],
"bbox": f"{bbox[2] + 1},{bbox[3] + 1},{bbox[2] + 2},{bbox[3] + 2}",
}
if bbox is not None:
get_params["bbox"] = f"{bbox[2] + 1},{bbox[3] + 1},{bbox[2] + 2},{bbox[3] + 2}"

if Method.GET in methods:
_, body, _ = retrieve(
Expand All @@ -3263,8 +3264,9 @@ def _validate_search_ids_with_ids_no_override(
post_params = {
"ids": [item["id"]],
"collections": [item["collection"]],
"bbox": [bbox[2] + 1, bbox[3] + 1, bbox[2] + 2, bbox[3] + 2],
}
if bbox is not None:
post_params["bbox"] = [bbox[2] + 1, bbox[3] + 1, bbox[2] + 2, bbox[3] + 2]

_, body, _ = retrieve(
Method.POST,
Expand Down
Loading