You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@madlib.apache.org by nk...@apache.org on 2019/11/21 17:48:00 UTC
[madlib] branch master updated: LDA: Turn off create table notices
This is an automated email from the ASF dual-hosted git repository.
nkak 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 d68e355 LDA: Turn off create table notices
d68e355 is described below
commit d68e355d011a492289fd9939d5d61964d9662089
Author: Nikhil Kak <nk...@pivotal.io>
AuthorDate: Mon Nov 18 15:45:07 2019 -0800
LDA: Turn off create table notices
JIRA: MADLIB-1395
Set client_min_messages to 'error' for all lda related functions to
silence any postgres notice messages.
---
src/ports/postgres/modules/lda/lda.sql_in | 15 ++++++++++-----
.../postgres/modules/utilities/text_utilities.sql_in | 3 ++-
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/ports/postgres/modules/lda/lda.sql_in b/src/ports/postgres/modules/lda/lda.sql_in
index 36e8106..814b0ae 100644
--- a/src/ports/postgres/modules/lda/lda.sql_in
+++ b/src/ports/postgres/modules/lda/lda.sql_in
@@ -1056,7 +1056,8 @@ MADLIB_SCHEMA.lda_train
)
RETURNS SETOF MADLIB_SCHEMA.lda_result AS $$
PythonFunctionBodyOnly(`lda', `lda')
- with AOControl(False):
+ from utilities.control import MinWarning
+ with AOControl(False) and MinWarning("error"):
lda.lda_train(schema_madlib, data_table, model_table, output_data_table,
voc_size, topic_num, iter_num, alpha, beta, None, None)
return [[model_table, 'model table'],
@@ -1133,7 +1134,8 @@ MADLIB_SCHEMA.lda_predict
)
RETURNS SETOF MADLIB_SCHEMA.lda_result AS $$
PythonFunctionBodyOnly(`lda', `lda')
- with AOControl(False):
+ from utilities.control import MinWarning
+ with AOControl(False) and MinWarning("error"):
lda.lda_predict(schema_madlib, data_table, model_table, output_table)
return [[
output_table,
@@ -1194,7 +1196,8 @@ MADLIB_SCHEMA.lda_get_word_topic_count
)
RETURNS SETOF MADLIB_SCHEMA.lda_result AS $$
PythonFunctionBodyOnly(`lda', `lda')
- with AOControl(False):
+ from utilities.control import MinWarning
+ with AOControl(False) and MinWarning("error"):
lda.get_word_topic_count(schema_madlib, model_table, output_table)
return [[output_table, 'per-word topic counts']]
$$ LANGUAGE plpythonu STRICT
@@ -1217,7 +1220,8 @@ MADLIB_SCHEMA.lda_get_topic_desc
)
RETURNS SETOF MADLIB_SCHEMA.lda_result AS $$
PythonFunctionBodyOnly(`lda', `lda')
- with AOControl(False):
+ from utilities.control import MinWarning
+ with AOControl(False) and MinWarning("error"):
lda.get_topic_desc(schema_madlib, model_table, vocab_table, desc_table, top_k)
return [[
desc_table,
@@ -1239,7 +1243,8 @@ MADLIB_SCHEMA.lda_get_word_topic_mapping
)
RETURNS SETOF MADLIB_SCHEMA.lda_result AS $$
PythonFunctionBodyOnly(`lda', `lda')
- with AOControl(False):
+ from utilities.control import MinWarning
+ with AOControl(False) and MinWarning("error"):
lda.get_word_topic_mapping(schema_madlib, lda_output_table, mapping_table)
return [[mapping_table, 'wordid - topicid mapping']]
$$ LANGUAGE plpythonu STRICT
diff --git a/src/ports/postgres/modules/utilities/text_utilities.sql_in b/src/ports/postgres/modules/utilities/text_utilities.sql_in
index 2438239..478e751 100644
--- a/src/ports/postgres/modules/utilities/text_utilities.sql_in
+++ b/src/ports/postgres/modules/utilities/text_utilities.sql_in
@@ -324,7 +324,8 @@ CREATE OR REPLACE FUNCTION MADLIB_SCHEMA.term_frequency(
RETURNS TEXT
AS $$
PythonFunctionBodyOnly(`utilities', `text_utilities')
- with AOControl(False):
+ from utilities.control import MinWarning
+ with AOControl(False) and MinWarning("error"):
return text_utilities.term_frequency(input_table, doc_id_col, word_vec_col,
output_table, compute_vocab=compute_vocab)
$$