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

Mi/feature/merge #1153

Merged
merged 2 commits into from
May 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions thoth/common/openshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -1506,10 +1506,11 @@ def schedule_qebhwt_workflow(

def schedule_mi_workflow(
self,
repository: str,
repository: Optional[str] = None,
entities: Optional[str] = None,
knowledge_path: Optional[str] = None,
mi_used_for_thoth: bool = False,
mi_used_for_thoth: Optional[bool] = False,
mi_merge: Optional[bool] = False,
*,
job_id: Optional[str] = None,
) -> Optional[str]:
Expand All @@ -1526,6 +1527,7 @@ def schedule_mi_workflow(
"ENTITIES": entities,
"KNOWLEDGE_PATH": knowledge_path,
"MI_THOTH": "1" if mi_used_for_thoth else "0",
"MI_MERGE": "1" if mi_merge else "0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Hint: booleans are ints in python: str(int(mi_merge))

Copy link
Member Author

@xtuchyna xtuchyna May 4, 2021

Choose a reason for hiding this comment

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

I know, I was just following other declarations in this file as well, see

"THOTH_ADVISER_DEV": "1" if dev else "0",

Can I then refactor these as e.g. "MI_MERGE": mi_merge ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hint: booleans are ints in python: str(int(mi_merge))

ooh I get it now, you mean it's better to use casting than the ternary operator

}

return self._schedule_workflow(
Expand Down