-
Notifications
You must be signed in to change notification settings - Fork 766
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the possibility of defining default decorators for steps (#1837)
* Add decorator source information This is in preparation of having default decorators injected by the user and/or various metaflow extensions. * Add support for default decorators * No removal of default decorators * Address comments Mechanism is now as follows: - users can set METAFLOW_DECOSPECS in their configuration or in the environment - extensions can set DECOSPECS in their config or set a list of TOGGLE_DECOSPECS METAFLOW_DECOSPECS/DECOSPECS is a string (space separated to form an array) Precedence order (from first priority to last): - DECOSPECS from extension if it sets DECOSPECS = ... - METAFLOW_DECOSPECS in the environment - METAFLOW_DECOSPECS in the configuration - DECOSPECS (default from extension if it uses from_conf...) - If still not set after all these checks, form by adding all the TOGGLE_DECOSPECS together * Forgot to remove old changes * One more * Typo * Address comments * Rework priority order of decorators. The order is now: - statically defined using a decorator - passed using --with - passed using METAFLOW_DECOSPECS in the environment variable - passed using METAFLOW_DECOSPECS in a configuration - passed using TOGGLE_DECOSPECS in the configuration Note that an error will occur if: - a decorator is defined statically and dynamically and it doesn't allow multiple An error will NOT be raised if: - a decorator is passed multiple times dynamically (newer ones are *ignored*) * Properly address order so that ./myflow.py --with foo run and ./myflow.py run --with foo both work properly
- Loading branch information
1 parent
5f57997
commit 3947a0b
Showing
3 changed files
with
89 additions
and
10 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