diff --git a/src/caosadvancedtools/table_json_conversion/convert.py b/src/caosadvancedtools/table_json_conversion/convert.py index 4b02fa46a8e7a2426118cd987e5d84f906e2dfdb..7d8060c01095a4c7e7a5c68298ddd643e47d4d78 100644 --- a/src/caosadvancedtools/table_json_conversion/convert.py +++ b/src/caosadvancedtools/table_json_conversion/convert.py @@ -707,8 +707,6 @@ def _set_in_nested(mydict: dict, path: list, value: Any, prefix: list = [], skip return mydict -# ToDo: Fix https://gitlab.indiscale.com/caosdb/src/caosdb-advanced-user-tools/-/issues/138 -# and remove pylint disable def to_dict(xlsx: Union[str, BinaryIO], schema: Union[dict, str, TextIO], validate: Optional[bool] = None, strict: bool = False) -> dict: """Convert the xlsx contents to a dict, it must follow a schema. @@ -733,9 +731,5 @@ def to_dict(xlsx: Union[str, BinaryIO], schema: Union[dict, str, TextIO], out: dict A dict representing the JSON with the extracted data. """ - if validate: - raise NotImplementedError( - "For input validation implement " - "https://gitlab.indiscale.com/caosdb/src/caosdb-advanced-user-tools/-/issues/138") converter = XLSXConverter(xlsx, schema, strict=strict) - return converter.to_dict() + return converter.to_dict(validate=validate) diff --git a/unittests/table_json_conversion/test_read_xlsx.py b/unittests/table_json_conversion/test_read_xlsx.py index ff32c6b1203112c6931e98e55de5e4c981167452..5bee9297478d70cc806d0e6759e9b9f5a7f9cb53 100644 --- a/unittests/table_json_conversion/test_read_xlsx.py +++ b/unittests/table_json_conversion/test_read_xlsx.py @@ -53,9 +53,7 @@ Returns json: dict The result of the conversion. """ - # FIXME Set default "validate" back to True, after implementation of - # https://gitlab.indiscale.com/caosdb/src/caosdb-advanced-user-tools/-/issues/138 - result = convert.to_dict(xlsx=xlsx_file, schema=schema_file, validate=validate) + result = convert.to_dict(xlsx=xlsx_file, schema=schema_file, validate=True) if known_good_file: with open(known_good_file, encoding="utf-8") as myfile: expected = json.load(myfile)