fix: update data validation in Data model (#6789)
* fix: enhance data validation in Data model * fix: Add warning for invalid data format in Data schema Modify data validation to log a warning when data is not a dictionary, preparing for a future error in version 1.3.0 * ✅ (test_data_class.py): add assertion to check if data attribute is an empty dictionary after calling get_text() method * 🐛 (data.py): fix issue where values["data"] could be None, causing potential errors in the code. Now ensuring "data" key exists and is initialized as an empty dictionary if it is not present. --------- Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
This commit is contained in:
parent
92d4fd0d52
commit
8f4515e655
2 changed files with 11 additions and 2 deletions
|
|
@ -138,3 +138,4 @@ def test_get_text_with_none_data():
|
|||
schema = Data(data=data, text_key="text", default_value="default")
|
||||
result = schema.get_text()
|
||||
assert result == "default"
|
||||
assert schema.data == {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue