def es_version()

in eland/common.py [0:0]


def es_version(es_client: Elasticsearch) -> Tuple[int, int, int]:
    """Tags the current ES client with a cached '_eland_es_version'
    property if one doesn't exist yet for the current Elasticsearch version.
    """
    eland_es_version: Tuple[int, int, int]
    if not hasattr(es_client, "_eland_es_version"):
        version_info = es_client.info()["version"]["number"]
        eland_es_version = parse_es_version(version_info)
        es_client._eland_es_version = eland_es_version  # type: ignore

        # Raise a warning if the major version of the library doesn't match the
        # the Elasticsearch server major version.
        if eland_es_version[0] != _ELAND_MAJOR_VERSION:
            warnings.warn(
                f"Eland major version ({_eland_version}) doesn't match the major "
                f"version of the Elasticsearch server ({version_info}) which can lead "
                f"to compatibility issues. Your Eland major version should be the same "
                "as your cluster major version.",
                stacklevel=2,
            )

    else:
        eland_es_version = es_client._eland_es_version
    return eland_es_version