-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pythonic config] Add warning message when config arg is not named 'c…
…onfig' (#16563) ## Summary Raises a warning message if an op/asset function has a parameter annotated with `dagster.Config` subclass that is not called `config`: ```python >>> @op ... def my_op(not_called_config: MyConfig): ... pass ... ConfigArgumentWarning: Parameter 'not_called_config' on op/asset function 'my_op' was annotated as a dagster.Config type. Did you mean to name this parameter 'config' instead? To mute this warning, invoke warnings.filterwarnings("ignore", category=dagster.ConfigArgumentWarning) or use one of the other methods described at https://docs.python.org/3/library/warnings.html#describing-warning-filters. warnings.warn( ``` Meant to address/improve situations like dagster-io/internal#6683 (comment) The user may quiet this warning by muting the new `dagster.ConfigArgumentWarning` warning type. ## Test Plan New unit test.
- Loading branch information
Showing
4 changed files
with
79 additions
and
2 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