jmarshrossney opened a new pull request, #1524: URL: https://github.com/apache/hamilton/pull/1524
Hello! This PR makes a trivial change to the delayed evaluation decorator (`@resolve`) so that it works with decorators such as `@extract_fields` which require their `validate()` method to have been called. Concretely, the "fix" is to call `validate()` (if it is defined) in `resolve.resolve`, before returning it. Prior to this change, using `@resolve` with `@extract_fields` results in an `AttributeError: 'extract_fields' object has no attribute 'resolved_fields'`. ## Changes Mainly.. - Call `decorator.validate()` before returning the decorator from `resolve.resolve`. - Add a unit test to test the combination of `resolve` and `extract_fields` specifically Also.. - Tweaked other unit tests in the same module which were failing after this change; performing the validation step checks for proper function annotations, so added dummy annodated functions inside these tests. - Removed an unreachable assert from `test_dynamic_fails_without_power_mode_fails`, and renamed it `test_dynamic_resolve_...` ## How I tested this ```sh pytest tests/functions_modifieds/test_delayed.py ``` ## Notes Intended to fix #1409 - I have the same goals/issues. This is my first contribution to this project. As a novice, the `CONTRIBUTING.md` guidelines could do with more detail! Note that the link to the developer setup guide appears broken. ## Checklist - [x] PR has an informative and human-readable title (this will be pulled into the release notes) - [x] Changes are limited to a single goal (no scope creep) - [x] Code passed the pre-commit check & code is left cleaner/nicer than when first encountered. - [x] Any _change_ in functionality is tested - [ ] (N/A) New functions are documented (with a description, list of inputs, and expected output) - [ ] (N/A) Placeholder code is flagged / future TODOs are captured in comments - [ ] (N/A) Project documentation has been updated if adding/changing functionality. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
