diff --git a/caveclient/base.py b/caveclient/base.py index c0ec83f8..054a1d13 100644 --- a/caveclient/base.py +++ b/caveclient/base.py @@ -234,16 +234,14 @@ def api_version(self): def _get_version(self) -> Optional[Version]: endpoint_mapping = self.default_url_mapping - url = self._endpoints["get_version"].format_map(endpoint_mapping) + url = self._endpoints.get("get_version", None).format_map(endpoint_mapping) response = self.session.get(url) - # TODO none_on_404 is not a thing - response = handle_response(response, as_json=True, none_on_404=True) - # if response.status_code == 404: # server doesn't have this endpoint yet - # return None - # else: - # version_str = response.json() - # version = Version(version_str) - # return version + if response.status_code == 404: # server doesn't have this endpoint yet + return None + else: + version_str = handle_response(response, as_json=True) + version = Version(version_str) + return version @property def server_version(self) -> Optional[Version]: diff --git a/caveclient/chunkedgraph.py b/caveclient/chunkedgraph.py index 74a660fb..8fa7c8bf 100644 --- a/caveclient/chunkedgraph.py +++ b/caveclient/chunkedgraph.py @@ -3,14 +3,13 @@ import datetime import json import logging -from typing import Iterable, Optional, Tuple, Union +from typing import Iterable, Tuple, Union from urllib.parse import urlencode import networkx as nx import numpy as np import pandas as pd import pytz -from packaging.version import Version from .auth import AuthClient from .base import ( @@ -200,8 +199,6 @@ def default_url_mapping(self): def table_name(self): return self._table_name - - def _process_timestamp(self, timestamp): """Process timestamp with default logic""" if timestamp is None: