-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remove error suppressor in async_utils.py and engine.py #2362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove error suppressor in async_utils.py and engine.py #2362
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the attempt @ChenyangLi4288
This however doesn't solve the issue.
Executor
class still works as before. Additionally this is creating incompatible exception handling.
run_coroutines
is anyway not used.
If you want to take another stab at it, follow the execution path:
apply_transforms() → run_async_tasks() → process_futures() → await future
Also, try not to introduce breaking changes.
Here's a professional reply for the PR: Thanks @anistark for the feedback! Following 1. # Catch exceptions and yield as results (keeps iterator going)
for future in futures:
try:
result = await future
except asyncio.CancelledError:
raise # Always propagate cancellation
except Exception as e:
result = e # Yield exception as result
yield result 2. # Log all errors and raise first exception after all tasks complete
first_exception = None
if isinstance(result, Exception):
logger.error(f"Task failed with {type(result).__name__}: {result}")
if first_exception is None:
first_exception = result
# After all tasks complete
if first_exception is not None:
raise first_exception Modified process_futures() and run_async_tasks() to:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this @ChenyangLi4288 !
Please rebase with main and fix the merge conflict so we can get this merged.
Fixed! Thank you! |
Thanks @ChenyangLi4288 Please run |
…Li4288/ragas into fix/RemoveErrorSuppress pull from ragas
Thank you @anistark, CI passed. |
Issue Link / Problem Description
Problem: Errors during testset generation transforms were being silently caught and suppressed
Changes Made
src/ragas/async_utils.py
: Removed exception suppression inprocess_futures()
function (lines 93-95)result = e
)src/ragas/testset/transforms/engine.py
: Removed exception suppression inrun_coroutines()
function (line 61)logger.error(...)
)Why these changes:
Testing
How to Test
generator.generate_with_langchain_docs()
orapply_transforms()
BadRequestError: temperature not supported
)ValueError: Node X has no summary_embedding
later in the pipelineExample test case (reproduces original issue):
References