h2o-py/h2o/h2o.py
def version_check():
    """Used to verify that h2o-python module and the H2O server are compatible with each other."""
    from .__init__ import __version__ as ver_pkg
    ci = h2oconn.cluster
    if not ci:
        raise H2OConnectionError("Connection not initialized. Did you run h2o.connect()?")
    ver_h2o = ci.version
    if ver_pkg == "SUBST_PROJECT_VERSION": ver_pkg = "UNKNOWN"
    if str(ver_h2o) != str(ver_pkg):
        branch_name_h2o = ci.branch_name
        build_number_h2o = ci.build_number
        if build_number_h2o is None or build_number_h2o == "unknown":
            raise H2OConnectionError(
                "Version mismatch. H2O is version {0}, but the h2o-python package is version {1}. "
                "Upgrade H2O and h2o-Python to latest stable version - "
                "http://h2o-release.s3.amazonaws.com/h2o/latest_stable.html"
                "".format(ver_h2o, ver_pkg))
        elif build_number_h2o == "99999":
            raise H2OConnectionError(
                "Version mismatch. H2O is version {0}, but the h2o-python package is version {1}. "
                "This is a developer build, please contact your developer."
                "".format(ver_h2o, ver_pkg))
        else:
            raise H2OConnectionError(
                "Version mismatch. H2O is version {0}, but the h2o-python package is version {1}. "
                "Install the matching h2o-Python version from - "
                "http://h2o-release.s3.amazonaws.com/h2o/{2}/{3}/index.html."
                "".format(ver_h2o, ver_pkg, branch_name_h2o, build_number_h2o))
    # Check age of the install
    if ci.build_too_old:
        print("Warning: Your H2O cluster version is too old ({})! Please download and install the latest "
              "version from http://h2o.ai/download/".format(ci.build_age))
def version_check():
    from .__init__ import __version__ as ver_pkg
    ci = h2oconn.cluster
    if not ci:
        raise H2OConnectionError("Connection not initialized. Did you run h2o.connect()?")
    ver_h2o = ci.version
    if ver_pkg == "SUBST_PROJECT_VERSION": ver_pkg = "UNKNOWN"
    if str(ver_h2o) != str(ver_pkg):
        branch_name_h2o = ci.branch_name
        build_number_h2o = ci.build_number
        if build_number_h2o is None or build_number_h2o == "unknown":
            raise H2OConnectionError(
                "Version mismatch. H2O is version {0}, but the h2o-python package is version {1}. "
                "Upgrade H2O and h2o-Python to latest stable version - "
                "http://h2o-release.s3.amazonaws.com/h2o/latest_stable.html"
                "".format(ver_h2o, ver_pkg))
        elif build_number_h2o == "99999":
            raise H2OConnectionError(
                "Version mismatch. H2O is version {0}, but the h2o-python package is version {1}. "
                "This is a developer build, please contact your developer."
                "".format(ver_h2o, ver_pkg))
        else:
            raise H2OConnectionError(
                "Version mismatch. H2O is version {0}, but the h2o-python package is version {1}. "
                "Install the matching h2o-Python version from - "
                "http://h2o-release.s3.amazonaws.com/h2o/{2}/{3}/index.html."
                "".format(ver_h2o, ver_pkg, branch_name_h2o, build_number_h2o))
    # Check age of the install
    if ci.build_too_old:
        print("Warning: Your H2O cluster version is too old ({})! Please download and install the latest "
              "version from http://h2o.ai/download/".format(ci.build_age))
def version_check ( ) : from . __init__ import __version__ as ver_pkg ci = h2oconn . cluster if not ci : raise H2OConnectionError ( "Connection not initialized. Did you run h2o.connect()?" ) ver_h2o = ci . version if ver_pkg == "SUBST_PROJECT_VERSION" : ver_pkg = "UNKNOWN" if str ( ver_h2o ) != str ( ver_pkg ) : branch_name_h2o = ci . branch_name build_number_h2o = ci . build_number if build_number_h2o is None or build_number_h2o == "unknown" : raise H2OConnectionError ( "Version mismatch. H2O is version {0}, but the h2o-python package is version {1}. " "Upgrade H2O and h2o-Python to latest stable version - " "http://h2o-release.s3.amazonaws.com/h2o/latest_stable.html" "" . format ( ver_h2o , ver_pkg ) ) elif build_number_h2o == "99999" : raise H2OConnectionError ( "Version mismatch. H2O is version {0}, but the h2o-python package is version {1}. " "This is a developer build, please contact your developer." "" . format ( ver_h2o , ver_pkg ) ) else : raise H2OConnectionError ( "Version mismatch. H2O is version {0}, but the h2o-python package is version {1}. " "Install the matching h2o-Python version from - " "http://h2o-release.s3.amazonaws.com/h2o/{2}/{3}/index.html." "" . format ( ver_h2o , ver_pkg , branch_name_h2o , build_number_h2o ) ) # Check age of the install if ci . build_too_old : print ( "Warning: Your H2O cluster version is too old ({})! Please download and install the latest " "version from http://h2o.ai/download/" . format ( ci . build_age ) )
Used to verify that h2o-python module and the H2O server are compatible with each other.
Used to verify that h2o - python module and the H2O server are compatible with each other .