-
Notifications
You must be signed in to change notification settings - Fork 103
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
Add Pydantic Extra.forbid
to shared base model config
#820
Conversation
…examples Signed-off-by: Flaviu Vadan <flaviuvadan@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #820 +/- ##
=======================================
+ Coverage 79.4% 79.6% +0.1%
=======================================
Files 45 45
Lines 3689 3726 +37
Branches 741 754 +13
=======================================
+ Hits 2932 2966 +34
- Misses 560 563 +3
Partials 197 197
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -107,6 +107,7 @@ Explore the examples through the side bar! | |||
| [template-defaults](https://github.com/argoproj/argo-workflows/blob/master/examples/template-defaults.yaml) | | |||
| [testvolume](https://github.com/argoproj/argo-workflows/blob/master/examples/testvolume.yaml) | | |||
| [timeouts-step](https://github.com/argoproj/argo-workflows/blob/master/examples/timeouts-step.yaml) | | |||
| [webhdfs-input-output-artifacts](https://github.com/argoproj/argo-workflows/blob/master/examples/webhdfs-input-output-artifacts.yaml) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI upstream example contains an extra field that is not accepted, so moved to hera examples. I looked at the OpenAPI spec on main and it does not have the field so moved until upstream is fixed
Extra.forbid
to shared base model config
Signed-off-by: Flaviu Vadan <flaviuvadan@gmail.com>
Signed-off-by: Sambhav Kothari <skothari44@bloomberg.net>
Signed-off-by: Flaviu Vadan <flaviuvadan@gmail.com>
Signed-off-by: Flaviu Vadan <flaviuvadan@gmail.com>
Signed-off-by: Flaviu Vadan <flaviuvadan@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good 💯 Only thing I want to confirm is whether errors will raise on unknown kwargs - could we add a unit test for it?
env: EnvT = None # type: ignore[assignment] | ||
env_from: EnvFromT = None # type: ignore[assignment] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does the linter have an issue with assignment here? 🤔 Are the "ignores" actually still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And you get this nonsense src/hera/workflows/user_container.py:43: error: Incompatible types in assignment (expression has type "Union[_BaseEnv, EnvVar, List[Union[_BaseEnv, EnvVar, Dict[str, Any]]], Dict[str, Any], None]", base class "UserContainer" defined the type as "Optional[List[EnvVar]]") [assignment]
tests/script_annotations_inputs_regression/script_annotations_artifacts_oss_old.py
Show resolved
Hide resolved
Signed-off-by: Flaviu Vadan <flaviuvadan@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, tiny word change first though
Co-authored-by: Elliot Gunton <egunton@bloomberg.net> Signed-off-by: Flaviu Vadan <flaviuvadan@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reverts commit a0c9272.
This reverts commit a0c9272. Signed-off-by: Flaviu Vadan <flaviuvadan@gmail.com>
Reverts #820 --------- Signed-off-by: Flaviu Vadan <flaviuvadan@gmail.com>
…examples
Pull Request Checklist
Description of PR
This PR adds the Pydantic
Extra.forbid
configuration to the shared base model. This means users will no longer be faced with silent semantic errors as outlined in #819. The core change is the base model. The rest of the changes are related to fixes after introducing the new config. For instance, there were Hera examples that usedsubpath
vssub_path
, which is exactly the sort of problem users have!