Github user njayaram2 commented on a diff in the pull request:

    https://github.com/apache/madlib/pull/271#discussion_r192175486
  
    --- Diff: src/madpack/upgrade_util.py ---
    @@ -1299,18 +1303,19 @@ def _clean_function(self):
             pattern = re.compile(r"""CREATE(\s+)FUNCTION""", re.DOTALL | 
re.IGNORECASE)
             self._sql = re.sub(pattern, 'CREATE OR REPLACE FUNCTION', 
self._sql)
     
    -    def cleanup(self, sql):
    +    def cleanup(self, sql, algoname):
             """
             @brief Entry function for cleaning the sql script
             """
             self._sql = sql
    -        self._clean_comment()
    -        self._clean_type()
    -        self._clean_cast()
    -        self._clean_operator()
    -        self._clean_opclass()
    -        self._clean_aggregate()
    -        self._clean_function()
    +        if algoname not in self.get_change_handler().newmodule:
    --- End diff --
    
    This if check was originally done in `madpack.py` before `cleanup()` 
function was called. We moved it to this function instead. Will add the 
comment, but keep the if logic as is, since we will anyway have to return at 
the end.


---

Reply via email to