fix: BLS-Import-UI und Timeout beim Daten-Apply
Datei-Button volle Breite, Import als Aktionsbutton, Batch-Upsert statt Einzel-INSERTs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
7ccae33844
commit
8e964509d7
7 files changed
+170
-145
No files matched your search
@@ -2,6 +2,7 @@ from io import BytesIO
|
||||
|
||||
from openpyxl import Workbook
|
||||
|
||||
from bls.import_service import should_persist_value
|
||||
from bls.parser import parse_components_xlsx, parse_foods_xlsx
|
||||
|
||||
|
||||
@@ -37,3 +38,9 @@ def test_parse_foods_keeps_bls_code():
|
||||
assert parsed["foods"][0]["name_de"] == "Hafer roh"
|
||||
vals = {v["attr_key"]: v["value_num"] for v in parsed["foods"][0]["values"]}
|
||||
assert vals.get("ENERCC") == 350
|
||||
|
||||
|
||||
def test_persist_only_numeric_or_trace():
|
||||
assert should_persist_value({"value_num": 1.2, "is_trace": False})
|
||||
assert should_persist_value({"value_num": None, "is_trace": True})
|
||||
assert not should_persist_value({"value_num": None, "is_trace": False})
|
||||
Reference in new issue
Block a user