From c858bf11ba289415e49023e8785af2ab9f5c392d Mon Sep 17 00:00:00 2001 From: Neel Shah Date: Tue, 10 Jun 2025 17:18:52 -0700 Subject: [PATCH 1/2] Support edgeOnlyLoad param for load magic --- src/graph_notebook/magics/graph_magic.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/graph_notebook/magics/graph_magic.py b/src/graph_notebook/magics/graph_magic.py index acf1a0e3..6cd156bb 100644 --- a/src/graph_notebook/magics/graph_magic.py +++ b/src/graph_notebook/magics/graph_magic.py @@ -2095,6 +2095,8 @@ def load(self, line='', local_ns: dict = None): parser.add_argument('--allow-empty-strings', action='store_true', default=False, help='Load empty strings found in node and edge property values.') parser.add_argument('-n', '--nopoll', action='store_true', default=False) + parser.add_argument('--edge-only-load', action='store_true', default=False, + help='Load the graph edges directly') args = parser.parse_args(line.split()) button = widgets.Button(description="Submit") @@ -2238,6 +2240,13 @@ def load(self, line='', local_ns: dict = None): disabled=False, layout=widgets.Layout(width=widget_width) ) + + edge_only_load = widgets.Dropdown( + options=['TRUE', 'FALSE'], + value=str(args.edge_only_load).upper(), + disabled=False, + layout=widgets.Layout(width=widget_width) + ) # Create a series of HBox containers that will hold the widgets and labels # 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): justify_content="flex-end")) poll_status_hbox = widgets.HBox([poll_status_label, poll_status]) + + edge_only_load_label = widgets.Label('Edge Only load:', + layout=widgets.Layout(width=label_width, + display="flex", + justify_content="flex-end")) + + edge_only_load_hbox = widgets.HBox([edge_only_load_label, edge_only_load]) def update_edge_ids_options(change): if change.new.lower() == FORMAT_OPENCYPHER: @@ -2399,7 +2415,7 @@ def update_parserconfig_options(change): # load arguments for Neptune bulk load bulk_load_boxes = [arn_hbox, mode_hbox, parallelism_hbox, cardinality_hbox, queue_hbox, dep_hbox, ids_hbox, allow_empty_strings_hbox, - named_graph_uri_hbox, base_uri_hbox, poll_status_hbox] + named_graph_uri_hbox, base_uri_hbox, poll_status_hbox, edge_only_load_hbox] submit_load_boxes = [button, output] if load_type == 'incremental': @@ -2418,6 +2434,7 @@ def on_button_clicked(b): base_uri_hbox.children = (base_uri_hbox_label, base_uri,) dep_hbox.children = (dep_hbox_label, dependencies,) concurrency_hbox.children = (concurrency_hbox_label, concurrency,) + edge_only_load_hbox.children = (edge_only_load_label, edge_only_load,) validated = True validation_label_style = DescriptionStyle(color='red') @@ -2473,7 +2490,8 @@ def on_button_clicked(b): 'parallelism': parallelism.value, 'updateSingleCardinalityProperties': update_single_cardinality.value, 'queueRequest': queue_request.value, - 'parserConfiguration': {} + 'parserConfiguration': {}, + 'edgeOnlyLoad': edge_only_load.value } if dependencies: @@ -2508,6 +2526,7 @@ def on_button_clicked(b): named_graph_uri_hbox.close() base_uri_hbox.close() concurrency_hbox.close() + edge_only_load_hbox.close() button.close() load_submit_status_output = widgets.Output() From 7d39c17eff9b4864ca069a266afe11f8a59c4373 Mon Sep 17 00:00:00 2001 From: Neel Shah Date: Tue, 10 Jun 2025 17:18:52 -0700 Subject: [PATCH 2/2] Support edgeOnlyLoad param for load magic --- src/graph_notebook/magics/graph_magic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graph_notebook/magics/graph_magic.py b/src/graph_notebook/magics/graph_magic.py index 6cd156bb..62fb1ecc 100644 --- a/src/graph_notebook/magics/graph_magic.py +++ b/src/graph_notebook/magics/graph_magic.py @@ -2096,7 +2096,7 @@ def load(self, line='', local_ns: dict = None): help='Load empty strings found in node and edge property values.') parser.add_argument('-n', '--nopoll', action='store_true', default=False) parser.add_argument('--edge-only-load', action='store_true', default=False, - help='Load the graph edges directly') + help='Assume there are only edge files present - do not scan for vertex files before loading edge files.') args = parser.parse_args(line.split()) button = widgets.Button(description="Submit")