mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-25 04:49:17 +00:00
core: Add ruff rule FBT003 (boolean-trap) (#29424)
See https://docs.astral.sh/ruff/rules/boolean-positional-value-in-call/#boolean-positional-value-in-call-fbt003 This PR also fixes some FBT001/002 in private methods but does not enforce these rules globally atm. Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
This commit is contained in:
committed by
GitHub
parent
4f8ea13cea
commit
558191198f
@@ -41,7 +41,7 @@ async def test_inline_handlers_share_parent_context() -> None:
|
||||
called.
|
||||
"""
|
||||
|
||||
def __init__(self, run_inline: bool) -> None:
|
||||
def __init__(self, *, run_inline: bool) -> None:
|
||||
"""Initialize the handler."""
|
||||
self.run_inline = run_inline
|
||||
|
||||
@@ -91,7 +91,7 @@ async def test_inline_handlers_share_parent_context_multiple() -> None:
|
||||
counter_var.reset(token)
|
||||
|
||||
class StatefulAsyncCallbackHandler(AsyncCallbackHandler):
|
||||
def __init__(self, name: str, run_inline: bool = True):
|
||||
def __init__(self, name: str, *, run_inline: bool = True):
|
||||
self.name = name
|
||||
self.run_inline = run_inline
|
||||
|
||||
|
Reference in New Issue
Block a user