madlib-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From orhankislal <...@git.apache.org>
Subject [GitHub] madlib pull request #194: Logregr: Add input validation for dep/indep variab...
Date Tue, 14 Nov 2017 19:49:40 GMT
Github user orhankislal commented on a diff in the pull request:

    https://github.com/apache/madlib/pull/194#discussion_r150943944
  
    --- Diff: src/ports/postgres/modules/regress/logistic.py_in ---
    @@ -158,12 +159,14 @@ def __logregr_validate_args(schema_madlib, tbl_source, tbl_output,
dep_col,
         if not dep_col or dep_col.strip().lower() in ('null', ''):
             plpy.error("Logregr error: Invalid dependent column name!")
     
    -    # if not columns_exist_in_table(tbl_source, [dep_col]):
    -    #     plpy.error("Logregr error: Dependent column does not exist!")
    +    if not is_var_valid(tbl_source, dep_col):
    +        plpy.error("Logregr error: Dependent variable is not valid!")
    --- End diff --
    
    Since the variable can be an expression and not a column, I wanted to avoid printing the
whole expression and making the error message long and confusing. We can easily add it if
you feel that would be more useful.


---

Mime
View raw message