Github user njayaram2 commented on a diff in the pull request: https://github.com/apache/madlib/pull/254#discussion_r178684532 --- Diff: src/ports/postgres/modules/utilities/mean_std_dev_calculator.py_in --- @@ -40,15 +41,27 @@ class MeanStdDevCalculator: self.dimension = dimension def get_mean_and_std_dev_for_ind_var(self): - set_zero_std_to_one = True - x_scaled_vals = utils_ind_var_scales(self.source_table, self.indep_var_array_str, self.dimension, self.schema_madlib, - None, # do not dump the output to a temp table - set_zero_std_to_one) + x_mean_table = None, # do not dump the output to a temp table + set_zero_std_to_one=True) x_mean_str = _array_to_string(x_scaled_vals["mean"]) x_std_str = _array_to_string(x_scaled_vals["std"]) + if not x_mean_str or not x_std_str: + plpy.error("mean/stddev for the independent variable" + "cannot be null") + return x_mean_str, x_std_str + + def create_mean_std_table_for_ind_var_grouping(self, x_mean_table, grouping_cols): + utils_ind_var_scales_grouping(self.source_table, + self.indep_var_array_str, + self.dimension, + self.schema_madlib, + grouping_cols, + x_mean_table, + set_zero_std_to_one = True, + create_temp_table = False) --- End diff -- Could you please correct the indentation here?
---