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

fix(sdk): Fix compiler bug for legacy outputs mlpipeline-ui-metadata and mlpipeline-metrics. Fixes #6311 #6325

Merged
merged 2 commits into from
Aug 13, 2021

Conversation

neuromage
Copy link
Contributor

Fixes the bug introduced by PR #6268

Fixes #6311

@neuromage
Copy link
Contributor Author

/assign @chensun

Copy link
Contributor

@Bobgy Bobgy left a comment

Choose a reason for hiding this comment

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

/lgtm

@@ -1062,6 +1062,15 @@ def __init__(self, argument, input=None, path=None):
self.path = path


def _is_legacy_output_name(output_name: str) -> Tuple[bool, str]:
normalized_output_name = re.sub('[^a-zA-Z0-9]', '-', output_name.lower())
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we have this transform in many places, shall we extract a common util?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that's what I just did here? :-)

Copy link
Contributor

Choose a reason for hiding this comment

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

what's the difference between this and

def sanitize_k8s_name(name, allow_capital_underscore=False):
?

Copy link
Contributor

Choose a reason for hiding this comment

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

and

  • def _sanitize_file_name(name):
    import re
    return re.sub('[^-_.0-9a-zA-Z]+', '_', name)
  • def sanitize_k8s_name(name, allow_capital_underscore=False):
    """Cleans and converts the names in the workflow.
    Args:
    name: original name,
    allow_capital_underscore: whether to allow capital letter and underscore in
    this name.
    Returns:
    A sanitized name.
    """
    if allow_capital_underscore:
    return re.sub('-+', '-', re.sub('[^-_0-9A-Za-z]+', '-',
    name)).lstrip('-').rstrip('-')
    else:
    return re.sub('-+', '-', re.sub('[^-0-9a-z]+', '-',
    name.lower())).lstrip('-').rstrip('-')
  • def _sanitize_name(name: str) -> str:
    """Sanitizes name to comply with IR naming convention.
    The sanitized name contains only lower case alphanumeric characters and
    dashes.
    """
    return re.sub('-+', '-', re.sub('[^-0-9a-z]+', '-',
    name.lower())).lstrip('-').rstrip('-')

looks like there's an implementation everywhere...

this is a non blocker for this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I don't see your point here. These different functions are used in different places. I don't think the goal of this PR is to refactor and clean up this code.

@Bobgy
Copy link
Contributor

Bobgy commented Aug 13, 2021

Thank you for fixing this quickly!

@Bobgy
Copy link
Contributor

Bobgy commented Aug 13, 2021

/lgtm

@Bobgy
Copy link
Contributor

Bobgy commented Aug 13, 2021

/approve
let's get the fix in first

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Bobgy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-robot google-oss-robot merged commit f743dde into kubeflow:master Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[testing] postsubmit test failure 2021-08-12
4 participants