Skip to content

Commit

Permalink
key existence check in filter
Browse files Browse the repository at this point in the history
  • Loading branch information
drewrip committed Jan 26, 2024
1 parent eb1476a commit 4dc4967
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions matrix_benchmarking/download_lts.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def main(opensearch_host: str = "",
opensearch_index: the OpenSearch index where the LTS payloads are stored (Mandatory)
lts_results_dirname: The directory to place the downloaded LTS results files.
filters: If provided, only download the experiments matching the filters. Eg: {"image_name": "1.2"}. (Optional.)
filters: If provided, only download the experiments matching the filters. Eg: {"image_name": "1.2"}.
If the provided value is "*", then we just check to ensure the keys existence (Optional.)
max_records: Maximum number of records to retrieve from the OpenSearch instance. 10,000 is the largest number possible without paging (Optional.)
force: Ignore the presence of the anchor file before downloading the results (Optional.)
clean: Delete all the existing '.json' files in the lts-results-dirname before downloading the results (Optional.)
Expand Down Expand Up @@ -119,7 +120,7 @@ def download(client, opensearch_index, filters, lts_results_dirname, max_records
query["query"] = {
"bool": {
"must": [
{"term": {f"{k}.keyword": v}} for k, v in filters.items()
{"term": {f"{k}.keyword": v}} if v != "*" else {"exists": {"field": k}} for k, v in filters.items()
]
}
}
Expand Down

0 comments on commit 4dc4967

Please sign in to comment.