@@ -70,21 +70,23 @@ async def process_entities(entities):
70
70
@click .option ('--max-token-size' , '-t' , default = 500 , help = 'max size of each token in megabytes (default 500, max 512)' )
71
71
@click .option ('--index' , '-i' , multiple = True , help = 'Label:Propery on which to create an index' )
72
72
@click .option ('--full-text-index' , '-f' , multiple = True , help = 'Label:Propery on which to create an full text search index' )
73
- @click .option ('--async-requests' , '-A' , default = 3 , help = 'amount of async requests to be executed in parallel' )
73
+ @click .option ('--async-requests' , '-A' , default = 3 , help = 'number of async requests to be executed in parallel' )
74
74
async def bulk_insert (graph , host , port , password , user , unix_socket_path , nodes , nodes_with_label , relations , relations_with_type , separator , enforce_schema , skip_invalid_nodes , skip_invalid_edges , escapechar , quote , max_token_count , max_buffer_size , max_token_size , index , full_text_index , async_requests ):
75
- if sys .version_info .major < 3 or sys .version_info .minor < 6 :
76
- raise Exception ("Python >= 3.6 is required for the RedisGraph bulk loader." )
75
+ if sys .version_info .major < 3 or sys .version_info .minor < 8 :
76
+ raise Exception ("Python >= 3.8 is required for the RedisGraph bulk loader." )
77
77
78
78
if not (any (nodes ) or any (nodes_with_label )):
79
79
raise Exception ("At least one node file must be specified." )
80
+ if async_requests <= 0 :
81
+ raise Exception ("The number of async requests must be greater than zero" )
80
82
81
83
start_time = timer ()
82
84
83
85
# If relations are being built, we must store unique node identifiers to later resolve endpoints.
84
86
store_node_identifiers = any (relations ) or any (relations_with_type )
85
87
86
88
# Initialize configurations with command-line arguments
87
- config = Config (max_token_count , max_buffer_size , max_token_size , enforce_schema , skip_invalid_nodes , skip_invalid_edges , separator , int (quote ), store_node_identifiers , escapechar )
89
+ config = Config (max_token_count , max_buffer_size , max_token_size , enforce_schema , skip_invalid_nodes , skip_invalid_edges , separator , int (quote ), store_node_identifiers , escapechar , async_requests )
88
90
89
91
# Attempt to connect to Redis server
90
92
try :
@@ -112,7 +114,7 @@ async def bulk_insert(graph, host, port, password, user, unix_socket_path, nodes
112
114
print ("Graph with name '%s', could not be created, as Redis key '%s' already exists." % (graph , graph ))
113
115
sys .exit (1 )
114
116
115
- query_buf = QueryBuffer (graph , client , config , async_requests )
117
+ query_buf = QueryBuffer (graph , client , config )
116
118
117
119
# Read the header rows of each input CSV and save its schema.
118
120
labels = parse_schemas (Label , query_buf , nodes , nodes_with_label , config )
0 commit comments