Exemplo n.º 1
0
    def legacy_server(self) -> bool:
        """Determine if the server is running a legacy version.

        Legacy versions support different session kinds than newer versions of
        Livy.
        """
        version = self.server_version()
        return version < Version("0.5.0-incubating")
Exemplo n.º 2
0
 def server_version(self) -> Version:
     """Get the version of Livy running on the server."""
     if self._server_version_cache is None:
         data = self._client.get("/version")
         self._server_version_cache = Version(data["version"])
     return self._server_version_cache
Exemplo n.º 3
0
 def legacy_server(self) -> bool:
     version = self.server_version()
     return version < Version("0.5.0-incubating")
Exemplo n.º 4
0
 def server_version(self) -> Version:
     if self._server_version_cache is None:
         data = self._client.get("/version")
         self._server_version_cache = Version(data["version"])
     return self._server_version_cache
Exemplo n.º 5
0
def test_version_equals(first, second):
    assert Version(first) == Version(second)
Exemplo n.º 6
0
def test_version_less_than(earlier, later):
    assert Version(earlier) < Version(later)
Exemplo n.º 7
0
 def server_version(self) -> Version:
     if self._server_version_cache is None:
         data = self._client.get('/version')
         self._server_version_cache = Version(data['version'])
     return self._server_version_cache