feat: start using dev mode flag and add exception filter in logger (#3260)

* refactor: reorganize logger module and add setup.py for logging configuration

* refactor: update logger import path to align with recent module restructuring

* refactor: add logging configuration parameter to Graph initialization for improved logging setup flexibility

* feat: create logging init module for improved logger configuration and management

* refactor: update Settings class to include development mode flag and associated validator for enhanced configuration management

* refactor: enhance logger.py with DEV mode handling and TypedDict for log configuration settings

* feat: add settings module with DEV mode flag and helper functions for setting development state

* refactor: update flow assertions in tests to check for Data object type instead of Flow object type

* feat: add deepcopy method to Graph class to copy start and end components, ensuring proper graph cloning functionality

* feat: implement deepcopy method in Component class for proper cloning of inputs and configuration attributes

* feat: enhance attribute access in Component class to support backwards-compatible private attributes retrieval

* feat: improve test assertion for list_flows in custom component to display types of returned objects for better debugging

* feat: refactor imports in constants.py and remove redundant Data class definition for cleaner code structure

* feat: refactor imports in logger.py to include NotRequired from typing_extensions for better type hinting support
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-08-09 10:59:49 -03:00 • committed by GitHub
commit 645c723d21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 133 additions and 19 deletions

View file

@ -1,7 +1,7 @@
import pytest
from langflow.custom.custom_component.custom_component import CustomComponent
from langflow.services.database.models.flow import Flow
from langflow.field_typing.constants import Data
@pytest.fixture
@ -20,4 +20,6 @@ def component(client, active_user):
def test_list_flows_flow_objects(component):
flows = component.list_flows()
assert all(isinstance(flow, Flow) for flow in flows)
are_flows = [isinstance(flow, Data) for flow in flows]
flow_types = [type(flow) for flow in flows]
assert all(are_flows), f"Expected all flows to be Data objects, got {flow_types}"

View file

@ -2,7 +2,7 @@ import pytest
import os
import json
from unittest.mock import patch
from langflow.utils.logger import SizedLogBuffer
from langflow.logging.logger import SizedLogBuffer
@pytest.fixture