From f3d50e9fea4c60a1908d539f8cdbc21fc2461f93 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Sat, 29 Apr 2023 07:37:16 -0300 Subject: [PATCH] formatting --- src/backend/langflow/cache/base.py | 8 +++----- src/backend/langflow/graph/base.py | 3 ++- src/backend/langflow/template/base.py | 4 ---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/backend/langflow/cache/base.py b/src/backend/langflow/cache/base.py index ba250da6b..ede0fb06e 100644 --- a/src/backend/langflow/cache/base.py +++ b/src/backend/langflow/cache/base.py @@ -8,12 +8,10 @@ import os import tempfile from collections import OrderedDict from pathlib import Path -from typing import Any -from PIL import Image -import dill -import pandas as pd # type: ignore +from typing import Any, Dict +import dill # type: ignore -CACHE = {} +CACHE: Dict[str, Any] = {} def create_cache_folder(func): diff --git a/src/backend/langflow/graph/base.py b/src/backend/langflow/graph/base.py index ae82d68d1..e661fec69 100644 --- a/src/backend/langflow/graph/base.py +++ b/src/backend/langflow/graph/base.py @@ -162,7 +162,8 @@ class Node: # If the key is "func", then we need to use the run method if key == "func": if not isinstance(result, types.FunctionType): - # func can be PythonFunction(code='\ndef upper_case(text: str) -> str:\n return text.upper()\n') + # func can be + # PythonFunction(code='\ndef upper_case(text: str) -> str:\n return text.upper()\n') # so we need to check if there is an attribute called run if hasattr(result, "run"): result = result.run # type: ignore diff --git a/src/backend/langflow/template/base.py b/src/backend/langflow/template/base.py index 860d2ac1e..bab3a7b2d 100644 --- a/src/backend/langflow/template/base.py +++ b/src/backend/langflow/template/base.py @@ -229,10 +229,6 @@ class FrontendNode(BaseModel): field.required = False if field.value is None: field.value = "" - # If the field.name contains api or api and key, then it might be an api key - # other conditions are to make sure that it is not an input or output variable - if "api" in key.lower() and "key" in key.lower(): - field.required = False if "kwargs" in field.name.lower(): field.advanced = True