julep
julep copied to clipboard
Fix isinstance union usage in agents-api
trafficstars
User description
Summary
- fix isinstance checks that used
|operator - adjust evaluator and task validation helpers
Testing
ruff format agents-api/agents_api/queries/utils.py agents-api/agents_api/common/utils/evaluator.py agents-api/agents_api/activities/task_steps/base_evaluate.py agents-api/agents_api/web.py agents-api/agents_api/workflows/task_execution/__init__.py agents-api/agents_api/common/utils/expressions.py agents-api/agents_api/common/utils/task_validation.pyruff check agents-api/agents_api/queries/utils.py agents-api/agents_api/common/utils/evaluator.py agents-api/agents_api/activities/task_steps/base_evaluate.py agents-api/agents_api/web.py agents-api/agents_api/workflows/task_execution/__init__.py agents-api/agents_api/common/utils/expressions.py agents-api/agents_api/common/utils/task_validation.pypip install pytype(fails: no network access)
PR Type
Bug fix
Description
-
Fix incorrect usage of
isinstancewith union types- Replace
isinstance(x, A | B)withisinstance(x, (A, B)) - Update all affected files for compatibility
- Replace
-
Improve type safety and error handling in evaluators and validators
Changes walkthrough 📝
| Relevant files | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Bug fix | 7 files
|
Need help?
Type /help how to ...in the comments thread for any questions about Qodo Merge usage.Check out the documentation for more information.
[!IMPORTANT] Fix
isinstancechecks using|operator to use tuples for compatibility inagents-apimodule.
- Behavior:
- Fix
isinstancechecks using|operator to use tuples for compatibility inbase_evaluate.py,evaluator.py, andweb.py.- Validation:
- Adjust
validate_py_expression()intask_validation.pyto use tuples inisinstancechecks.- Misc:
- Run
rufffor formatting and linting on affected files.- Attempted
pytypeinstallation failed due to no network access.This description was created by
for 7ad9ffc378801cee85a8ae33ac5af2d9e94a90dc. You can customize this summary. It will automatically update as commits are pushed.