pyzeebe
pyzeebe copied to clipboard
Bugfix/all variables injected when function has no variables
Fix bug where function decorated as task receives all variables that are available to the task causing an unexpected keyword argument error. Referenced in #337.
The bug originates from the zeebe grpc API for ActivateJobs. If no variables are passed to fetchVariable , it fetches all available variables.
Changes
- Add a
include_variablesflag to private function_create_job_from_raw_job. If flag is set to False, retrieved variables will be ignored. The function is called in one place, which now calls it withbool(variables_to_fetch)as the flag's value.Noneor an empty list will cause no variables to be injected to theJobobject, so they will never end up getting passed to the function.
API Updates
New Features (required)
- Support for functions with no arguments as task functions
Checklist
- [x] Unit tests
- [x] Documentation
References
Fixes #337
Looks good, but please add a simple unit test so that this bug doesn't reproduce.
Looks good, but please add a simple unit test so that this bug doesn't reproduce.
Done.
Something to have in mind that someone mentioned to me - this pr will remove the ability to intentionally get all parameters by setting the variables_to_fetch to [] or None.
I don't think that's a problem or intended functionality, but just making sure
Waiting for re-review :)
fixed in #404