Conversation
|
This works: And Doesn't produce warnings |
|
How is this a better solution than what I described here? This feels very complicated in comparison to just changing the order of decorators. |
The code is wrong in python terms, we need to fix it, but I will do it with unit test so we make sure we are not introducing new bugs. |
From Gemini:
So I think this code assumes that if you do not yield in one of the exuction paths, it becomes a normal function, but actually it becomes a generator that will produce an empy list. Hence, you need two use different wrappers if you want to returns sometimes a generator and sometimes you want to return a non-generator. So a function can return some times a function that is a generator, and sometimes a function that is not a generator. But a function itself it is always either a generator or not. I found about this writing this PR: #4440 and the unit tests, allow me to see this more clearly. |
|
@leolara next time please just post a new comment instead of editing mine. I'm just unsure of this PR because I don't fully understand what's going on here. Instead of creating a new function, why not just change the if emit:
if out is not None:
yield from out
else:
return out |
|
@jtraglia I think it is ready but we should not merge without running reftests in this branch |
The reference test generator is fixed. Please test this & report back. |
Hmm this isn't right. This is for |
As by this screenshot of this link, it is:
|
Ah yes. I misunderstood what the commit on the main page meant. It must be the workflow commit.
|
jtraglia
left a comment
There was a problem hiding this comment.
The core changes look fine to me. I assume most of the new infra tests are AI generated. I skimmed them and they seem decent enough.
I gave bad advice to a new contributor. We "fixed" one issue & broke something else. See this link for context: #4652 (comment) This PR simply reverts the changes from that PR. The fix in the following PR is the correct fix: #4658


Fixes #4618 - Warnings when running tests
Fixes #4659 - decorator vector_test has parameter description is never used
Fixes #4661 - decorator with_config_overrides parameter emit is unnecesary
Note: we should run the reftests on this before merging.