Skip to content

retrieve version from server as is #969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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