Skip to content

Commit

Permalink
retrieve version from server as is (#969)
Browse files Browse the repository at this point in the history
* retrieve version from server as is

* unused datetime import
  • Loading branch information
tschaume authored Feb 26, 2025
1 parent 5bff18e commit 5828eeb
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions mp_api/client/core/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import warnings
from concurrent.futures import FIRST_COMPLETED, ThreadPoolExecutor, wait
from copy import copy
from datetime import datetime
from functools import cache
from importlib.metadata import PackageNotFoundError, version
from json import JSONDecodeError
Expand Down Expand Up @@ -223,18 +222,12 @@ def _get_database_version(endpoint):
remains unchanged and available for querying via its task_id.
The database version is set as a date in the format YYYY_MM_DD,
where "_DD" may be optional. An additional numerical suffix
where "_DD" may be optional. An additional numerical or `postN` suffix
might be added if multiple releases happen on the same day.
Returns: database version as a string
"""
date_str = requests.get(url=endpoint + "heartbeat").json()["db_version"]
# Convert the string to a datetime object
date_obj = datetime.strptime(date_str, "%Y.%m.%d")

# Format the datetime object as a string
formatted_date = date_obj.strftime("%Y.%m.%d")
return formatted_date
return requests.get(url=endpoint + "heartbeat").json()["db_version"]

def _post_resource(
self,
Expand Down

0 comments on commit 5828eeb

Please sign in to comment.