Add new task types and support for Server API version 2.8

This commit is contained in:
allegroai
2020-05-31 12:11:48 +03:00
parent 92d003657b
commit dcd16abd3b
14 changed files with 20948 additions and 8 deletions

View File

@@ -162,7 +162,8 @@ class Session(TokenManager):
if not api_version:
api_version = '2.2' if token_dict.get('env', '') == 'prod' else Session.api_version
if token_dict.get('server_version'):
Session._client.append(('trains-server', token_dict.get('server_version'), ))
if not any(True for c in Session._client if c[0] == 'trains-server'):
Session._client.append(('trains-server', token_dict.get('server_version'), ))
Session.api_version = str(api_version)
except (jwt.DecodeError, ValueError):