@@ -307,6 +307,14 @@ File table_to_pmml.sql_in documenting the PMML export functions.
307307CREATE OR REPLACE FUNCTION MADLIB_SCHEMA.pmml(
308308 model_table varchar
309309) RETURNS xml AS $$
310+
311+ import collections
312+ import collections.abc
313+ if not hasattr(collections, 'MutableSequence'):
314+ collections.MutableSequence = collections.abc.MutableSequence
315+ collections.MutableMapping = collections.abc.MutableMapping
316+ collections.MutableSet = collections.abc.MutableSet
317+
310318PythonFunction(pmml, table_to_pmml, table_to_pmml)
311319$$ LANGUAGE plpython3u
312320m4_ifdef(`__HAS_FUNCTION_PROPERTIES__', `READS SQL DATA', `');
@@ -325,6 +333,14 @@ CREATE OR REPLACE FUNCTION MADLIB_SCHEMA.pmml(
325333 model_table varchar
326334 , name_spec varchar
327335) RETURNS xml AS $$
336+
337+ import collections
338+ import collections.abc
339+ if not hasattr(collections, 'MutableSequence'):
340+ collections.MutableSequence = collections.abc.MutableSequence
341+ collections.MutableMapping = collections.abc.MutableMapping
342+ collections.MutableSet = collections.abc.MutableSet
343+
328344PythonFunction(pmml, table_to_pmml, table_to_pmml)
329345$$ LANGUAGE plpython3u
330346m4_ifdef(`__HAS_FUNCTION_PROPERTIES__', `READS SQL DATA', `');
@@ -343,6 +359,14 @@ CREATE OR REPLACE FUNCTION MADLIB_SCHEMA.pmml(
343359 model_table varchar
344360 , name_spec varchar[]
345361) RETURNS xml AS $$
362+
363+ import collections
364+ import collections.abc
365+ if not hasattr(collections, 'MutableSequence'):
366+ collections.MutableSequence = collections.abc.MutableSequence
367+ collections.MutableMapping = collections.abc.MutableMapping
368+ collections.MutableSet = collections.abc.MutableSet
369+
346370PythonFunction(pmml, table_to_pmml, table_to_pmml)
347371$$ LANGUAGE plpython3u
348372m4_ifdef(`__HAS_FUNCTION_PROPERTIES__', `READS SQL DATA', `');
@@ -351,6 +375,14 @@ m4_ifdef(`__HAS_FUNCTION_PROPERTIES__', `READS SQL DATA', `');
351375-- Help messages -------------------------------------------------------
352376CREATE OR REPLACE FUNCTION MADLIB_SCHEMA.pmml()
353377RETURNS TEXT AS $$
378+
379+ import collections
380+ import collections.abc
381+ if not hasattr(collections, 'MutableSequence'):
382+ collections.MutableSequence = collections.abc.MutableSequence
383+ collections.MutableMapping = collections.abc.MutableMapping
384+ collections.MutableSet = collections.abc.MutableSet
385+
354386 PythonFunction(pmml, table_to_pmml, pmml_help_msg)
355387$$ LANGUAGE plpython3u IMMUTABLE
356388m4_ifdef(`__HAS_FUNCTION_PROPERTIES__', `CONTAINS SQL', `');
0 commit comments