
import warnings
from ai.h2o.sparkling.ExternalBackendConf import ExternalBackendConf
from ai.h2o.sparkling.Initializer import Initializer
from ai.h2o.sparkling.InternalBackendConf import InternalBackendConf
from ai.h2o.sparkling.SharedBackendConf import SharedBackendConf
from pyspark.ml.util import _jvm


class H2OConf(SharedBackendConf, InternalBackendConf, ExternalBackendConf):
    def __init__(self, spark=None):
        try:
            if spark is not None:
                warnings.warn(
                    "Constructor H2OConf(spark) with spark argument is deprecated. Please use just H2OConf(). "
                    "The argument will be removed in release 3.32.")
            Initializer.load_sparkling_jar()
            self._jconf = _jvm().org.apache.spark.h2o.H2OConf()
        except:
            raise


from ai.h2o.sparkling.ExternalBackendConf import ExternalBackendConf
from ai.h2o.sparkling.Initializer import Initializer
from ai.h2o.sparkling.InternalBackendConf import InternalBackendConf
from ai.h2o.sparkling.SharedBackendConf import SharedBackendConf
from pyspark.ml.util import _jvm


class H2OConf(SharedBackendConf, InternalBackendConf, ExternalBackendConf):
    def __init__(self):
        try:
            Initializer.load_sparkling_jar()
            self._jconf = _jvm().org.apache.spark.h2o.H2OConf()
        except:
            raise

Remove deprecated method H2OContext.getOrCreate with sparkSession or SparkContext argument
[SW-1971][FollowUp] Remove deprecated method H2OContext.getOrCreate with sparkSession or SparkContext argument

  
- import warnings
  from ai.h2o.sparkling.ExternalBackendConf import ExternalBackendConf
  from ai.h2o.sparkling.Initializer import Initializer
  from ai.h2o.sparkling.InternalBackendConf import InternalBackendConf
  from ai.h2o.sparkling.SharedBackendConf import SharedBackendConf
  from pyspark.ml.util import _jvm
  
  
  class H2OConf(SharedBackendConf, InternalBackendConf, ExternalBackendConf):
-     def __init__(self, spark=None):
+     def __init__(self):
          try:
-             if spark is not None:
-                 warnings.warn(
-                     "Constructor H2OConf(spark) with spark argument is deprecated. Please use just H2OConf(). "
-                     "The argument will be removed in release 3.32.")
              Initializer.load_sparkling_jar()
              self._jconf = _jvm().org.apache.spark.h2o.H2OConf()
          except:
              raise
  
Remove deprecated method H2OContext.getOrCreate with sparkSession or SparkContext argument
## Code Before:

import warnings
from ai.h2o.sparkling.ExternalBackendConf import ExternalBackendConf
from ai.h2o.sparkling.Initializer import Initializer
from ai.h2o.sparkling.InternalBackendConf import InternalBackendConf
from ai.h2o.sparkling.SharedBackendConf import SharedBackendConf
from pyspark.ml.util import _jvm


class H2OConf(SharedBackendConf, InternalBackendConf, ExternalBackendConf):
    def __init__(self, spark=None):
        try:
            if spark is not None:
                warnings.warn(
                    "Constructor H2OConf(spark) with spark argument is deprecated. Please use just H2OConf(). "
                    "The argument will be removed in release 3.32.")
            Initializer.load_sparkling_jar()
            self._jconf = _jvm().org.apache.spark.h2o.H2OConf()
        except:
            raise

## Instruction:
Remove deprecated method H2OContext.getOrCreate with sparkSession or SparkContext argument
## Code After:

from ai.h2o.sparkling.ExternalBackendConf import ExternalBackendConf
from ai.h2o.sparkling.Initializer import Initializer
from ai.h2o.sparkling.InternalBackendConf import InternalBackendConf
from ai.h2o.sparkling.SharedBackendConf import SharedBackendConf
from pyspark.ml.util import _jvm


class H2OConf(SharedBackendConf, InternalBackendConf, ExternalBackendConf):
    def __init__(self):
        try:
            Initializer.load_sparkling_jar()
            self._jconf = _jvm().org.apache.spark.h2o.H2OConf()
        except:
            raise
