You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sdap.apache.org by rk...@apache.org on 2023/03/31 16:45:25 UTC

[incubator-sdap-nexus] branch master updated: SDAP-444 - Fixed resultSizeLimit truncating result storage in match_spark (#234)

This is an automated email from the ASF dual-hosted git repository.

rkk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-nexus.git


The following commit(s) were added to refs/heads/master by this push:
     new d611d75  SDAP-444 - Fixed resultSizeLimit truncating result storage in match_spark (#234)
d611d75 is described below

commit d611d75518da430916bd3cf3dd59c167bdbb7bfc
Author: Riley Kuttruff <72...@users.noreply.github.com>
AuthorDate: Fri Mar 31 09:45:18 2023 -0700

    SDAP-444 - Fixed resultSizeLimit truncating result storage in match_spark (#234)
    
    * SDAP-444: Don't overwrite matches variable as it messes up what is stored
    
    * Changelog
    
    ---------
    
    Co-authored-by: rileykk <ri...@jpl.nasa.gov>
---
 CHANGELOG.md                                    | 1 +
 analysis/webservice/algorithms_spark/Matchup.py | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 911ecfd..841ed00 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - SDAP-434: Fix for webapp Docker image build failure
 - SDAP-412: Explicit definition of `__eq__` and `__hash__` in matchup `DomsPoint` class. This ensures all primary-secondary pairs with the same primary point are merged in the `combineByKey` step.
 - SDAP-438: Replace variable value NaN with None to fix error in result storage
+- SDAP-444: Fixed `resultSizeLimit` param in `/match_spark` truncating the results that are stored for the results endpoint.
 ### Security
 
 ## [1.0.0] - 2022-12-05
diff --git a/analysis/webservice/algorithms_spark/Matchup.py b/analysis/webservice/algorithms_spark/Matchup.py
index 25251cd..6cd4676 100644
--- a/analysis/webservice/algorithms_spark/Matchup.py
+++ b/analysis/webservice/algorithms_spark/Matchup.py
@@ -304,9 +304,11 @@ class Matchup(NexusCalcSparkHandler):
         # Get only the first "result_size_limit" results
         # '0' means returns everything
         if result_size_limit > 0:
-            matches = matches[0:result_size_limit]
+            return_matches = matches[0:result_size_limit]
+        else:
+            return_matches = matches
 
-        result = DomsQueryResults(results=matches, args=args,
+        result = DomsQueryResults(results=return_matches, args=args,
                                   details=details, bounds=None,
                                   count=len(matches), computeOptions=None,
                                   executionId=execution_id)