fix: truncate transaction and vertex messages (#7893)
* add pyinstrument and fastapi wrapper * Truncate vertex build responses * Truncate vertex response and transactions * [autofix.ci] apply automated fixes * Update test for vertex response structure to reflect new truncation logic * Refactor profiling middleware to use environment variable for configuration * Update test for vertex response structure to correct truncation logic * move pyinstrument to dev dependencies * Update serialization test to include max_items parameter for list truncation * remove profiling from this PR, fix constants * [autofix.ci] apply automated fixes * Add asyncio configuration options to pyproject.toml --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
This commit is contained in:
parent
304e28b48a
commit
2c6ea9c98f
7 changed files with 2915 additions and 2915 deletions
|
|
@ -63,7 +63,7 @@ def test_vertex_response_structure_when_truncate_applies():
|
|||
("size", "expected"),
|
||||
[
|
||||
(0, 0),
|
||||
(42, 42),
|
||||
(8, 8),
|
||||
(MAX_ITEMS_LENGTH, MAX_ITEMS_LENGTH),
|
||||
(MAX_ITEMS_LENGTH + 1000, MAX_ITEMS_LENGTH + 1),
|
||||
(MAX_ITEMS_LENGTH + 2000, MAX_ITEMS_LENGTH + 1),
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class TestSerializationHypothesis:
|
|||
@settings(max_examples=100)
|
||||
@given(lst=list_strategy)
|
||||
def test_list_truncation(self, lst: list) -> None:
|
||||
result: list = serialize(lst)
|
||||
result: list = serialize(lst, max_items=MAX_ITEMS_LENGTH)
|
||||
if len(lst) > MAX_ITEMS_LENGTH:
|
||||
assert len(result) == MAX_ITEMS_LENGTH + 1
|
||||
assert f"... [truncated {len(lst) - MAX_ITEMS_LENGTH} items]" in result
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue