Skip to content

Env var ENABLE_DATETIME_INDEX_FILTERING="false" evaluated as truthy in bulk insert #726

@alambare

Description

@alambare

Describe the bug
Setting the environment variable ENABLE_DATETIME_INDEX_FILTERING to " false" is evaluated as truthy in the bulk insert item endpoint.

The bug is caused by https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/blob/main/stac_fastapi/core/stac_fastapi/core/core.py#L1432 that uses os.getenv() instead of the get_bool_env() function.

To Reproduce

Enable the BulkTransactionExtension and set ENABLE_DATETIME_INDEX_FILTERING="false"

Expected behavior

"false" should be considered as false.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions