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
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):

View file

@ -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

View file

@ -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