diff --git a/.gitignore b/.gitignore index 9ad7a01..d1feef9 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ __pycache__/ .ipynb_checkpoints/ /.venv +/node_modules/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6ec8c05..2b7cbae 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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 diff --git a/src/stac_api_validator/validations.py b/src/stac_api_validator/validations.py index 0dd290f..1c126dd 100644 --- a/src/stac_api_validator/validations.py +++ b/src/stac_api_validator/validations.py @@ -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( @@ -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,