22import random
33import string
44import uuid
5- from typing import Any , Dict
5+ from typing import Any , Dict , Optional
66
77import numpy as np
88import pytest # type: ignore
99from gremlin_python .process .traversal import Direction , T
1010
1111import awswrangler as wr
1212import awswrangler .pandas as pd
13+ from awswrangler .neptune ._client import BulkLoadParserConfiguration
1314
1415from .._utils import extract_cloudformation_outputs
1516
@@ -259,8 +260,20 @@ def test_gremlin_bulk_load_error_when_files_present(
259260 )
260261
261262
263+ DEFAULT_PARSER_CONFIGURATION = BulkLoadParserConfiguration (
264+ namedGraphUri = "http://aws.amazon.com/neptune/vocab/v01/DefaultNamedGraph" ,
265+ baseUri = "http://aws.amazon.com/neptune/default" ,
266+ allowEmptyStrings = False ,
267+ )
268+
269+
270+ @pytest .mark .parametrize ("parser_config" , [None , DEFAULT_PARSER_CONFIGURATION ])
262271def test_gremlin_bulk_load_from_files (
263- neptune_endpoint : str , neptune_port : int , neptune_load_iam_role_arn : str , path : str
272+ neptune_endpoint : str ,
273+ neptune_port : int ,
274+ neptune_load_iam_role_arn : str ,
275+ path : str ,
276+ parser_config : Optional [BulkLoadParserConfiguration ],
264277) -> None :
265278 client = wr .neptune .connect (neptune_endpoint , neptune_port , iam_enabled = False )
266279
@@ -274,6 +287,7 @@ def test_gremlin_bulk_load_from_files(
274287 client = client ,
275288 path = path ,
276289 iam_role = neptune_load_iam_role_arn ,
290+ parser_configuration = parser_config ,
277291 )
278292 res_df = wr .neptune .execute_gremlin (client , f"g.V().hasLabel('{ label } ').valueMap().with(WithOptions.tokens)" )
279293
0 commit comments