dify/api/tests/unit_tests/core
QuantumGhost 2c1ab4879f
refactor(api): Separate SegmentType for Integer/Float to Enable Pydantic Serialization (#22025)
refactor(api): Separate SegmentType for Integer/Float to Enable Pydantic Serialization (#22025)

This PR addresses serialization issues in the VariablePool model by separating the `value_type` tags for `IntegerSegment`/`FloatSegment` and `IntegerVariable`/`FloatVariable`. Previously, both Integer and Float types shared the same `SegmentType.NUMBER` tag, causing conflicts during serialization.

Key changes:
- Introduce distinct `value_type` tags for Integer and Float segments/variables
- Add `VariableUnion` and `SegmentUnion` types for proper type discrimination
- Leverage Pydantic's discriminated union feature for seamless serialization/deserialization
- Enable accurate serialization of data structures containing these types

Closes #22024.
2025-07-16 12:31:37 +08:00
..
agent/output_parser fix: code block syntax cannot be displayed correctly in react mode (#16904) 2025-03-31 16:27:29 +08:00
app fix(api): files not returned in the answer node (#21807) 2025-07-02 13:54:10 +08:00
file feat: Persist Variables for Enhanced Debugging Workflow (#20699) 2025-06-24 09:05:29 +08:00
helper test: add comprehensive unit tests for encrypter module (#22102) 2025-07-10 10:01:15 +08:00
mcp/client feat: add MCP support (#20716) 2025-07-10 14:01:34 +08:00
model_runtime fix: invalid new tool call creation logic during response handling in OAI-Compat model (#17781) 2025-04-17 16:52:49 +08:00
ops feat: add unit tests and validation for aliyun tracing (#22012) 2025-07-08 09:32:30 +08:00
prompt Refactor/remove db from cycle manager (#20455) 2025-05-30 04:34:13 +08:00
rag fix: markdown_extractor lost chunks if it starts without a header(#21308) (#21309) 2025-06-21 23:10:00 +08:00
repositories feat(api/repo): Allow to config repository implementation (#21458) 2025-07-14 14:54:38 +08:00
tools fix: generate deterministic operationId for root endpoints without one (#19888) 2025-07-15 14:19:55 +08:00
variables refactor(api): Separate SegmentType for Integer/Float to Enable Pydantic Serialization (#22025) 2025-07-16 12:31:37 +08:00
workflow refactor(api): Separate SegmentType for Integer/Float to Enable Pydantic Serialization (#22025) 2025-07-16 12:31:37 +08:00
__init__.py FEAT: NEW WORKFLOW ENGINE (#3160) 2024-04-08 18:51:46 +08:00
test_file.py feat(llm_node): support order in text and files (#11837) 2024-12-20 14:12:50 +08:00
test_model_manager.py ext_redis.py support redis clusters --- Fixes #9538 (#9789) 2024-11-20 13:44:35 +08:00
test_provider_manager.py Introduce Plugins (#13836) 2025-02-17 17:05:13 +08:00