1+ import json
12import os
23from pathlib import Path
34
67from mindee import ClientV2 , InferenceParameters , PathInput , UrlInputSource
78from mindee .error .mindee_http_error_v2 import MindeeHTTPErrorV2
89from mindee .parsing .v2 import InferenceActiveOptions
9- from mindee .input .inference_parameters import DataSchema
1010from mindee .parsing .v2 .inference_response import InferenceResponse
11- from tests .utils import FILE_TYPES_DIR , V2_PRODUCT_DATA_DIR
11+ from tests .utils import FILE_TYPES_DIR , V2_PRODUCT_DATA_DIR , V2_DATA_DIR
1212
1313
1414@pytest .fixture (scope = "session" )
@@ -285,6 +285,9 @@ def test_data_schema_must_succeed(
285285 Load a blank PDF from an HTTPS URL and make sure the inference call completes without raising any errors.
286286 """
287287 input_path : Path = FILE_TYPES_DIR / "pdf" / "blank_1.pdf"
288+ data_schema_replace_path = (
289+ V2_DATA_DIR / "inference" / "data_schema_replace_param.json"
290+ )
288291
289292 input_source = PathInput (input_path )
290293 params = InferenceParameters (
@@ -294,20 +297,8 @@ def test_data_schema_must_succeed(
294297 polygon = False ,
295298 confidence = False ,
296299 webhook_ids = [],
297- data_schema = DataSchema (
298- replace = {
299- "fields" : [
300- {
301- "name" : "test" ,
302- "title" : "Test" ,
303- "is_array" : False ,
304- "type" : "string" ,
305- "description" : "A test field" ,
306- }
307- ]
308- }
309- ),
310- alias = "py_integration_data_schema_override" ,
300+ data_schema = json .loads (data_schema_replace_path .read_text ()),
301+ alias = "py_integration_data_schema_replace" ,
311302 )
312303 response : InferenceResponse = v2_client .enqueue_and_get_inference (
313304 input_source , params
0 commit comments