Skip to content

Commit b17c490

Browse files
MikiPWataparambharat
authored andcommitted
[FIX]Ruff: lint errors for E731 (langgenius#13018)
1 parent 7cd6d72 commit b17c490

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

api/.ruff.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ ignore = [
4545
"E712", # true-false-comparison
4646
"E721", # type-comparison
4747
"E722", # bare-except
48-
"E731", # lambda-assignment
4948
"F821", # undefined-name
5049
"F841", # unused-variable
5150
"FURB113", # repeated-append

api/models/workflow.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,10 @@ def environment_variables(self) -> Sequence[Variable]:
256256

257257
# decrypt secret variables value
258258
def decrypt_func(var):
259-
return (
260-
var.model_copy(update={"value": encrypter.decrypt_token(tenant_id=tenant_id, token=var.value)})
261-
if isinstance(var, SecretVariable)
262-
else var
263-
)
259+
if isinstance(var, SecretVariable):
260+
return var.model_copy(update={"value": encrypter.decrypt_token(tenant_id=tenant_id, token=var.value)})
261+
else:
262+
return var
264263

265264
results = list(map(decrypt_func, results))
266265
return results
@@ -286,11 +285,10 @@ def environment_variables(self, value: Sequence[Variable]):
286285

287286
# encrypt secret variables value
288287
def encrypt_func(var):
289-
return (
290-
var.model_copy(update={"value": encrypter.encrypt_token(tenant_id=tenant_id, token=var.value)})
291-
if isinstance(var, SecretVariable)
292-
else var
293-
)
288+
if isinstance(var, SecretVariable):
289+
return var.model_copy(update={"value": encrypter.encrypt_token(tenant_id=tenant_id, token=var.value)})
290+
else:
291+
return var
294292

295293
encrypted_vars = list(map(encrypt_func, value))
296294
environment_variables_json = json.dumps(

0 commit comments

Comments
 (0)