Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
smellycloud committed Jan 14, 2025
1 parent 1036ffb commit e352f23
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
15 changes: 10 additions & 5 deletions views_pipeline_core/managers/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,11 +808,16 @@ def __get_pred_store_name(self) -> str:
year = current_date.year
month = str(current_date.month).zfill(2)

pred_store_name = (
"v"
+ "".join(part.zfill(2) for part in version.split("."))
+ f"_{year}_{month}"
)
try:
if version is None:
version = "0.1.0"
pred_store_name = (
"v"
+ "".join(part.zfill(2) for part in version.split("."))
+ f"_{year}_{month}"
)
except Exception as e:
logger.error(f"Error generating prediction store name: {e}")

if pred_store_name not in ViewsMetadata().get_runs().name.tolist():
logger.warning(
Expand Down
4 changes: 2 additions & 2 deletions views_pipeline_core/managers/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ def get_latest_release_version_from_github(
response = requests.get(github_url)
if response.status_code == 200:
data = response.json()
if "tag_name" in data and data["tag_name"] is not None:
if "tag_name" in data and data["tag_name"] != "":
return data["tag_name"].lstrip("v")
elif "name" in data and data["name"] is not None:
elif "name" in data and data["name"] != "":
return data["name"].lstrip("v")
else:
logging.error("No releases found for this repository.")
Expand Down

0 comments on commit e352f23

Please sign in to comment.