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

[CROSS VERSION TEST] Fix regular expression to capture flavor name from changed files #3887

Merged
merged 1 commit into from Dec 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions dev/set_matrix.py
Expand Up @@ -195,7 +195,11 @@ def get_changed_flavors(changed_files, flavors):
['pytorch', 'xgboost']
>>> get_changed_flavors(["mlflow/xgboost.py"], flavors)
['xgboost']
>>> get_changed_flavors(["tests/xgboost/test_xgboost_autolog.py"], flavors)
>>> get_changed_flavors(["tests/xgboost/test_xxx.py"], flavors)
['xgboost']
>>> get_changed_flavors(["tests/xgboost_autolog/test_xxx.py"], flavors)
['xgboost']
>>> get_changed_flavors(["tests/xgboost_autologging/test_xxx.py"], flavors)
['xgboost']
>>> get_changed_flavors(["README.rst"], flavors)
harupy marked this conversation as resolved.
Show resolved Hide resolved
[]
Expand All @@ -204,7 +208,10 @@ def get_changed_flavors(changed_files, flavors):
"""
changed_flavors = []
for f in changed_files:
match = re.search(r"^(mlflow|tests)/(.+?)(\.py|/)", f)
pattern = r"^(mlflow|tests)/(.+?)(_autolog(ging)?)?(\.py|/)"
# ~~~~~
# # This group captures a flavor name
match = re.search(pattern, f)
harupy marked this conversation as resolved.
Show resolved Hide resolved

if (match is not None) and (match.group(2) in flavors):
changed_flavors.append(match.group(2))
Expand Down