Github user iyerr3 commented on a diff in the pull request:
https://github.com/apache/madlib/pull/214#discussion_r156472963
--- Diff: src/ports/postgres/modules/stats/correlation.py_in ---
@@ -179,9 +179,11 @@ def _populate_output_table(schema_madlib,
source_table, output_table,
function_name = "Correlation"
agg_str = "{0}.correlation_agg(x, mean)".format(schema_madlib)
- cols = ','.join(["coalesce({0}, avg_{0})".format(col) for col in
col_names])
- avgs = ','.join(["avg({0}) AS avg_{0}".format(col) for col in
col_names])
- avg_array = ','.join(["avg_{0}".format(col) for col in col_names])
+ cols = ','.join(["coalesce({0}, ".format(col)+add_postfix(col,
"_avg")+")"
--- End diff --
Preferred to keep it within the format string i.e.
```
cols = ','.join(["coalesce({0}, {1})".format(col, add_postfix(col, "_avg")
for col in col_names])
```
Same applies to the line below.
---