Skip to content

Commit 5828eeb

Browse files
authored
retrieve version from server as is (#969)
* retrieve version from server as is * unused datetime import
1 parent 5bff18e commit 5828eeb

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

mp_api/client/core/client.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import warnings
1515
from concurrent.futures import FIRST_COMPLETED, ThreadPoolExecutor, wait
1616
from copy import copy
17-
from datetime import datetime
1817
from functools import cache
1918
from importlib.metadata import PackageNotFoundError, version
2019
from json import JSONDecodeError
@@ -223,18 +222,12 @@ def _get_database_version(endpoint):
223222
remains unchanged and available for querying via its task_id.
224223
225224
The database version is set as a date in the format YYYY_MM_DD,
226-
where "_DD" may be optional. An additional numerical suffix
225+
where "_DD" may be optional. An additional numerical or `postN` suffix
227226
might be added if multiple releases happen on the same day.
228227
229228
Returns: database version as a string
230229
"""
231-
date_str = requests.get(url=endpoint + "heartbeat").json()["db_version"]
232-
# Convert the string to a datetime object
233-
date_obj = datetime.strptime(date_str, "%Y.%m.%d")
234-
235-
# Format the datetime object as a string
236-
formatted_date = date_obj.strftime("%Y.%m.%d")
237-
return formatted_date
230+
return requests.get(url=endpoint + "heartbeat").json()["db_version"]
238231

239232
def _post_resource(
240233
self,

0 commit comments

Comments
 (0)