madlib-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From orhankislal <>
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:
    --- Diff: src/ports/postgres/modules/regress/logistic.py_in ---
    @@ -158,12 +159,14 @@ def __logregr_validate_args(schema_madlib, tbl_source, tbl_output,
         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.


View raw message