madlib-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iyerr3 <...@git.apache.org>
Subject [GitHub] madlib pull request #204: Added additional distance metrics for k-NN: Jira-1...
Date Mon, 20 Nov 2017 22:30:49 GMT
Github user iyerr3 commented on a diff in the pull request:

    https://github.com/apache/madlib/pull/204#discussion_r152122803
  
    --- Diff: src/ports/postgres/modules/knn/knn.py_in ---
    @@ -88,12 +88,28 @@ def knn_validate_src(schema_madlib, point_source, point_column_name,
point_id,
             plpy.error("kNN Error: Data type '{0}' is not a valid type for"
                        " column '{1}' in table '{2}'.".
                        format(col_type_test, test_id, test_source))
    +
    +    fn_dist = fn_dist.lower().strip()
    +    dist_functions = {
    --- End diff --
    
    I believe set comprehension was introduced in Python 2.7 and if IIRC there are some supported
platforms that are still on 2.6. Can be replaced as 
    ```
    dist_functions = set([schema_madlib + dist for dist in 
             ('.dist_norm1', '.dist_norm2', '.squared_dist_norm2', '.dist_angle', '.dist_tanimoto')])
    ```


---

Mime
View raw message