Skip to content

Commit 094800b

Browse files
authored
Support edgeOnlyLoad param for load magic (#750)
* Support edgeOnlyLoad param for load magic
1 parent b8ce87b commit 094800b

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

src/graph_notebook/magics/graph_magic.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2095,6 +2095,8 @@ def load(self, line='', local_ns: dict = None):
20952095
parser.add_argument('--allow-empty-strings', action='store_true', default=False,
20962096
help='Load empty strings found in node and edge property values.')
20972097
parser.add_argument('-n', '--nopoll', action='store_true', default=False)
2098+
parser.add_argument('--edge-only-load', action='store_true', default=False,
2099+
help='Assume there are only edge files present - do not scan for vertex files before loading edge files.')
20982100

20992101
args = parser.parse_args(line.split())
21002102
button = widgets.Button(description="Submit")
@@ -2238,6 +2240,13 @@ def load(self, line='', local_ns: dict = None):
22382240
disabled=False,
22392241
layout=widgets.Layout(width=widget_width)
22402242
)
2243+
2244+
edge_only_load = widgets.Dropdown(
2245+
options=['TRUE', 'FALSE'],
2246+
value=str(args.edge_only_load).upper(),
2247+
disabled=False,
2248+
layout=widgets.Layout(width=widget_width)
2249+
)
22412250

22422251
# Create a series of HBox containers that will hold the widgets and labels
22432252
# that make up the %load form. Some of the labels and widgets are created
@@ -2347,6 +2356,13 @@ def load(self, line='', local_ns: dict = None):
23472356
justify_content="flex-end"))
23482357

23492358
poll_status_hbox = widgets.HBox([poll_status_label, poll_status])
2359+
2360+
edge_only_load_label = widgets.Label('Edge Only load:',
2361+
layout=widgets.Layout(width=label_width,
2362+
display="flex",
2363+
justify_content="flex-end"))
2364+
2365+
edge_only_load_hbox = widgets.HBox([edge_only_load_label, edge_only_load])
23502366

23512367
def update_edge_ids_options(change):
23522368
if change.new.lower() == FORMAT_OPENCYPHER:
@@ -2399,7 +2415,7 @@ def update_parserconfig_options(change):
23992415
# load arguments for Neptune bulk load
24002416
bulk_load_boxes = [arn_hbox, mode_hbox, parallelism_hbox, cardinality_hbox,
24012417
queue_hbox, dep_hbox, ids_hbox, allow_empty_strings_hbox,
2402-
named_graph_uri_hbox, base_uri_hbox, poll_status_hbox]
2418+
named_graph_uri_hbox, base_uri_hbox, poll_status_hbox, edge_only_load_hbox]
24032419
submit_load_boxes = [button, output]
24042420

24052421
if load_type == 'incremental':
@@ -2418,6 +2434,7 @@ def on_button_clicked(b):
24182434
base_uri_hbox.children = (base_uri_hbox_label, base_uri,)
24192435
dep_hbox.children = (dep_hbox_label, dependencies,)
24202436
concurrency_hbox.children = (concurrency_hbox_label, concurrency,)
2437+
edge_only_load_hbox.children = (edge_only_load_label, edge_only_load,)
24212438

24222439
validated = True
24232440
validation_label_style = DescriptionStyle(color='red')
@@ -2473,7 +2490,8 @@ def on_button_clicked(b):
24732490
'parallelism': parallelism.value,
24742491
'updateSingleCardinalityProperties': update_single_cardinality.value,
24752492
'queueRequest': queue_request.value,
2476-
'parserConfiguration': {}
2493+
'parserConfiguration': {},
2494+
'edgeOnlyLoad': edge_only_load.value
24772495
}
24782496

24792497
if dependencies:
@@ -2508,6 +2526,7 @@ def on_button_clicked(b):
25082526
named_graph_uri_hbox.close()
25092527
base_uri_hbox.close()
25102528
concurrency_hbox.close()
2529+
edge_only_load_hbox.close()
25112530
button.close()
25122531

25132532
load_submit_status_output = widgets.Output()

0 commit comments

Comments
 (0)