gchq / gaffer-tools

gaffer-tools is deprecated. Use https://github.com/gchq/gafferpy instead
Apache License 2.0
50 stars 29 forks source link

Gafferpy tidy up operation parameter handling #896

Closed t92549 closed 3 years ago

t92549 commented 3 years ago

Currently in the Gafferpy codebase there is a non-pythonic pattern of processing operation parameters by doing something like this: https://github.com/gchq/gaffer-tools/blob/bbf0634ceeb8d587c6107ca4827fe75d6c2c8dbd/python-shell/src/gafferpy/gaffer_operations.py#L2381-L2388 Not only is this over-complicated, but it causes bugs when one of those cases is missed (#870). Fishbowl does not have this issue due to the nature of it having no error checking and presuming everything is json.

@sw96411 suggested an improvement on https://github.com/gchq/gaffer-tools/pull/890#discussion_r634368419 which is more pythonic, easier to read and less bug prone.

t92549 commented 3 years ago

Also worth noting that while changing to this approach, it should be easier to avoid bugs like in #851.