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')])
```
---