Consider updated fields for Jinja2 based computed attributes #5307
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes in this PR
Note in this iteration I've only isolated the change to when we are actually running the Computed Attributes, it will save us from querying the backend with the SDK when we know that it isn't strictly required.
I view this as an initial step to improve the performance a bit. The next iteration of this would be to modify the event automations so that the triggers themselves have these fields built in. I think it would be nice to refactor the automations in general as we'll end up with potentially quite a few additional automations when this is in place. Most of the code for this was already in place since before we started using it as automations in Prefect but the filtering was ignored as we always sent in an empty list for "updated_fields".
Also I really dislike that I did with the "update_fields" parameter and the use of ujson, we have this with the webhooks too. Would like a cleaner solution.
Final note: To improve things in a similar way for the Transforms I think we really have to spend time to rewrite and enhance the GraphQLQueryAnalyzer.