Skip to content

fix: use identity checks for type comparisons; remove mutable default argument - #2277

Open
harshadkhetpal wants to merge 1 commit into
Open-Source-Legal:mainfrom
harshadkhetpal:fix/type-identity-and-mutable-default
Open

fix: use identity checks for type comparisons; remove mutable default argument#2277
harshadkhetpal wants to merge 1 commit into
Open-Source-Legal:mainfrom
harshadkhetpal:fix/type-identity-and-mutable-default

Conversation

@harshadkhetpal

Copy link
Copy Markdown

Summary

  1. opencontractserver/llms/tools/tool_factory.py — the annotation→JSON-schema dispatch chain compares type objects with == five times (param.annotation == int, float, bool, list, dict) — ruff E721. Identity (is) is the intended semantics for type objects and avoids surprises with metaclass-defined __eq__.

  2. opencontractserver/pipeline/utils.pyrun_post_processors(..., input_kwargs: dict[str, Any] = {}) shares one dict across every call (ruff B006). Changed to the None sentinel with input_kwargs = input_kwargs or {} after the docstring; identical behavior for all callers.

Testing

python -m py_compile passes on both files; ruff check --select B006,E721 on them goes clean.

🤖 Generated with Claude Code

… argument

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Harshad Khetpal <harshadkhetpal@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant