You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@madlib.apache.org by ok...@apache.org on 2020/02/25 18:00:10 UTC
[madlib] branch master updated: Summary: Fix defaults when the user
passes NULL
This is an automated email from the ASF dual-hosted git repository.
okislal pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/madlib.git
The following commit(s) were added to refs/heads/master by this push:
new c473be2 Summary: Fix defaults when the user passes NULL
c473be2 is described below
commit c473be2467cedb16c89b89ca5ef84465dc0624fc
Author: Orhan Kislal <ok...@apache.org>
AuthorDate: Tue Feb 18 17:51:11 2020 -0500
Summary: Fix defaults when the user passes NULL
JIRA: MADLIB-1413
Summarizer used python defaults for setting up the optional parameters.
If the user passes a NULL, these values get overwritten. This commit
fixes this issue by moving the defaults inside the code.
---
src/ports/postgres/modules/summary/Summarizer.py_in | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/ports/postgres/modules/summary/Summarizer.py_in b/src/ports/postgres/modules/summary/Summarizer.py_in
index 277fa7f..5790972 100644
--- a/src/ports/postgres/modules/summary/Summarizer.py_in
+++ b/src/ports/postgres/modules/summary/Summarizer.py_in
@@ -11,8 +11,8 @@ class Summarizer:
def __init__(self, schema_madlib, source_table, output_table,
target_cols, grouping_cols, distinctify, get_quartiles,
- xtileify='Exact', ntile_array=None, how_many_mfv=10,
- get_mfv_quick=False, n_cols_per_run=15):
+ xtileify, ntile_array, how_many_mfv, get_mfv_quick,
+ n_cols_per_run):
self._schema_madlib = schema_madlib
self._source_table = source_table
self._output_table = output_table
@@ -20,11 +20,11 @@ class Summarizer:
self._target_cols = target_cols
self._distinctify = distinctify
self._get_quartiles = get_quartiles
- self._xtileify = xtileify
+ self._xtileify = xtileify if xtileify else 'Exact'
self._ntile_array = ntile_array
- self._how_many_mfv = how_many_mfv
- self._get_mfv_quick = get_mfv_quick
- self._n_cols_per_run = n_cols_per_run
+ self._how_many_mfv = how_many_mfv if how_many_mfv is not None else 10
+ self._get_mfv_quick = get_mfv_quick if get_mfv_quick is not None else False
+ self._n_cols_per_run = n_cols_per_run if n_cols_per_run is not None else 15
self._columns = None
self._column_names = None
self._delimiter = '_.*.&.!.!.&.*_'