mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-26 05:48:40 +00:00
community: Bump ruff version to 0.9 (#29206)
Co-authored-by: Erick Friis <erick@langchain.dev>
This commit is contained in:
committed by
GitHub
parent
30f6c9f5c8
commit
723031d548
@@ -66,9 +66,9 @@ def get_execute_function_sql_stmt(
|
||||
else:
|
||||
parts.append(f"SELECT * FROM {function.full_name}(")
|
||||
if function.input_params is None or function.input_params.parameters is None:
|
||||
assert (
|
||||
not json_params
|
||||
), "Function has no parameters but parameters were provided."
|
||||
assert not json_params, (
|
||||
"Function has no parameters but parameters were provided."
|
||||
)
|
||||
else:
|
||||
args = []
|
||||
use_named_args = False
|
||||
@@ -213,17 +213,17 @@ def execute_function(
|
||||
assert response.status is not None, f"Statement execution failed: {response}"
|
||||
if response.status.state != StatementState.SUCCEEDED:
|
||||
error = response.status.error
|
||||
assert (
|
||||
error is not None
|
||||
), f"Statement execution failed but no error message was provided: {response}"
|
||||
assert error is not None, (
|
||||
f"Statement execution failed but no error message was provided: {response}"
|
||||
)
|
||||
return FunctionExecutionResult(error=f"{error.error_code}: {error.message}")
|
||||
manifest = response.manifest
|
||||
assert manifest is not None
|
||||
truncated = manifest.truncated
|
||||
result = response.result
|
||||
assert (
|
||||
result is not None
|
||||
), "Statement execution succeeded but no result was provided."
|
||||
assert result is not None, (
|
||||
"Statement execution succeeded but no result was provided."
|
||||
)
|
||||
data_array = result.data_array
|
||||
if is_scalar(function):
|
||||
value = None
|
||||
@@ -234,9 +234,9 @@ def execute_function(
|
||||
)
|
||||
else:
|
||||
schema = manifest.schema
|
||||
assert (
|
||||
schema is not None and schema.columns is not None
|
||||
), "Statement execution succeeded but no schema was provided."
|
||||
assert schema is not None and schema.columns is not None, (
|
||||
"Statement execution succeeded but no schema was provided."
|
||||
)
|
||||
columns = [c.name for c in schema.columns]
|
||||
if data_array is None:
|
||||
data_array = []
|
||||
|
Reference in New Issue
Block a user