formatting

This commit is contained in:
Gabriel Almeida 2023-04-29 07:37:16 -03:00
commit f3d50e9fea
3 changed files with 5 additions and 10 deletions

View file

@ -8,12 +8,10 @@ import os
import tempfile import tempfile
from collections import OrderedDict from collections import OrderedDict
from pathlib import Path from pathlib import Path
from typing import Any from typing import Any, Dict
from PIL import Image import dill # type: ignore
import dill
import pandas as pd # type: ignore
CACHE = {} CACHE: Dict[str, Any] = {}
def create_cache_folder(func): def create_cache_folder(func):

View file

@ -162,7 +162,8 @@ class Node:
# If the key is "func", then we need to use the run method # If the key is "func", then we need to use the run method
if key == "func": if key == "func":
if not isinstance(result, types.FunctionType): 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 # so we need to check if there is an attribute called run
if hasattr(result, "run"): if hasattr(result, "run"):
result = result.run # type: ignore result = result.run # type: ignore

View file

@ -229,10 +229,6 @@ class FrontendNode(BaseModel):
field.required = False field.required = False
if field.value is None: if field.value is None:
field.value = "" 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(): if "kwargs" in field.name.lower():
field.advanced = True field.advanced = True