Skip to content

Commit

Permalink
Don't throw an exception in update_mlflow_versions if the new version…
Browse files Browse the repository at this point in the history
… is lower (mlflow#13285)

Signed-off-by: Daniel Lok <[email protected]>
Signed-off-by: k99kurella <[email protected]>
  • Loading branch information
daniellok-db authored and karthikkurella committed Jan 30, 2025
1 parent 0116b6f commit d059bed
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions dev/update_mlflow_versions.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import logging
import re
from pathlib import Path
from typing import List, Union

import click
from packaging.version import Version

_logger = logging.getLogger(__name__)

_PYTHON_VERSION_FILES = [
Path("mlflow", "version.py"),
]
Expand Down Expand Up @@ -171,10 +174,17 @@ def validate_new_version(
) -> str:
new = Version(value)
current = Version(get_current_py_version())

# this could be the case if we just promoted an RC to a release
if new < current:
raise click.BadParameter(
f"New version {new} is not greater than or equal to current version {current}"
_logger.warning(
f"New version {new} is not greater than or equal to current version {current}. "
"If the previous version was an RC, this is expected. If not, please make sure the "
"specified new version is correct."
)
# exit with 0 to avoid failing the CI job
exit(0)

return value


Expand Down

0 comments on commit d059bed

Please sign in to comment.