Skip to content

Commit

Permalink
HC-503: Fixed an issue where job_iterator could return duplicate resu…
Browse files Browse the repository at this point in the history
…lts (#59)

* HC-503: Set sort in job_iterator so that the result query won't return duplicate results

* fix sort statement

* bump version

* debugging stuff

* testing

* print statement

* add sort back in

* remove kludge

---------

Co-authored-by: Mike Cayanan <[email protected]>
  • Loading branch information
mcayanan and Mike Cayanan authored Dec 18, 2023
1 parent 62d0747 commit 8f7b72d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hysds_commons/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
from __future__ import division
from __future__ import absolute_import

__version__ = "1.1.0"
__version__ = "1.1.1"
__description__ = "Common HySDS Functions, Utilities, Etc."
__url__ = "https://github.jpl.nasa.gov/hysds-org/hysds_commons"
5 changes: 3 additions & 2 deletions hysds_commons/job_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ def iterate(component, rule):

# Run the query to get the products; for efficiency, run query only if we need the results
results = [{"_id": "Transient Faux-Results"}]
sort = ["@timestamp:desc", "id.keyword:asc"]
if run_query:
if component == "mozart" or component == "figaro":
results = mozart_es.query(index=es_index, body=queryobj)
results = mozart_es.query(index=es_index, body=queryobj, sort=sort)
else:
results = grq_es.query(index=es_index, body=queryobj)
results = grq_es.query(index=es_index, body=queryobj, sort=sort)

# What to iterate for submission
submission_iterable = [{"_id": "Global Single Submission"}] if single else results
Expand Down

0 comments on commit 8f7b72d

Please sign in to comment.