-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/momix-integration' into momix-in…
…tegration
- Loading branch information
Showing
7 changed files
with
46 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from typing import Any, Dict, List | ||
|
||
|
||
def key_is_in_entrypoint_arguments(key: str, arguments: List[Dict[str, Any]]) -> bool: | ||
"""Checks if a key is in the entrypoint arguments.""" | ||
for arg in arguments: | ||
if arg['name'] == key: | ||
return True | ||
return False | ||
|
||
|
||
def schedule_request_is_valid(request_data: Dict[str, Any]) -> bool: | ||
"""Checks that all the parameters to schedule a task to EMR is valid.""" | ||
return request_data is not None and \ | ||
"name" in request_data and \ | ||
"algorithm" in request_data and \ | ||
"entrypoint_arguments" in request_data and \ | ||
key_is_in_entrypoint_arguments("app-name", request_data['entrypoint_arguments']) |