Skip to content
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

[SDK] Support string values in min/max replicas #2606

Merged

Conversation

GiladShapira94
Copy link
Contributor

Copy link
Member

@liranbg liranbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd move the verification + assignment under a common helper, and set it to be

def as_number(field_name, field_value)
if (
            isinstance(field_value, str)
            and not field_value.isnumeric()
        ):
            raise ValueError(f"{field_name} must be numeric")
return int(field_value)

and then, use it from anywhere, without repeating the logic

DRY

@GiladShapira94
Copy link
Contributor Author

@liranbg - fixed

@quaark quaark changed the title Support string values [SDK] Support string values in min/max replicas Nov 22, 2022
@quaark quaark merged commit edc00df into mlrun:development Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants