Skip to content

Commit

Permalink
Remove unused options from %load (aws#662)
Browse files Browse the repository at this point in the history
* Remove --periodic-commit option from %load

* update changelog
  • Loading branch information
michaelnchin authored Aug 8, 2024
1 parent d97aef4 commit 42f2f0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 27 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Starting with v1.31.6, this file will contain a record of major features and upd

## Upcoming

- Removed unused options from `%load`([Link to PR](https://github.com/aws/graph-notebook/pull/662))

## Release 4.5.1 (July 31, 2024)

- Added `%create_graph_snapshot` line magic ([Link to PR](https://github.com/aws/graph-notebook/pull/653))
Expand Down
30 changes: 3 additions & 27 deletions src/graph_notebook/magics/graph_magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@
RDF_LOAD_FORMATS = [FORMAT_NTRIPLE, FORMAT_NQUADS, FORMAT_RDFXML, FORMAT_TURTLE]
BASE_URI_FORMATS = [FORMAT_RDFXML, FORMAT_TURTLE]
DEFAULT_LOAD_CONCURRENCY = 1
DEFAULT_LOAD_PERIODIC_COMMIT = 0

MEDIA_TYPE_SPARQL_JSON = "application/sparql-results+json"
MEDIA_TYPE_SPARQL_XML = "application/sparql-results+xml"
Expand Down Expand Up @@ -1962,7 +1961,6 @@ def load(self, line='', local_ns: dict = None):
parser.add_argument('-d', '--dependencies', action='append', default=[])
parser.add_argument('-e', '--no-edge-ids', action='store_true', default=False)
parser.add_argument('-c', '--concurrency', type=int, default=1)
parser.add_argument('-pc', '--periodic-commit', type=int, default=0)
parser.add_argument('--named-graph-uri', type=str, default=DEFAULT_NAMEDGRAPH_URI,
help='The default graph for all RDF formats when no graph is specified. '
'Default is http://aws.amazon.com/neptune/vocab/v01/DefaultNamedGraph.')
Expand Down Expand Up @@ -2005,11 +2003,9 @@ def load(self, line='', local_ns: dict = None):
named_graph_hbox_visibility = 'none'
base_uri_hbox_visibility = 'none'
concurrency_hbox_visibility = 'none'
periodic_commit_hbox_visibility = 'none'

if load_type == 'incremental':
concurrency_hbox_visibility = 'flex'
periodic_commit_hbox_visibility = 'flex'
else:
if source_format.value.lower() == FORMAT_CSV:
gremlin_parser_options_hbox_visibility = 'flex'
Expand Down Expand Up @@ -2111,16 +2107,6 @@ def load(self, line='', local_ns: dict = None):
width=widget_width)
)

periodic_commit = widgets.BoundedIntText(
value=args.periodic_commit,
placeholder=0,
min=0,
max=1000000,
disabled=False,
layout=widgets.Layout(display=periodic_commit_hbox_visibility,
width=widget_width)
)

poll_status = widgets.Dropdown(
options=['TRUE', 'FALSE'],
value=str(not args.nopoll).upper(),
Expand Down Expand Up @@ -2230,13 +2216,6 @@ def load(self, line='', local_ns: dict = None):

concurrency_hbox = widgets.HBox([concurrency_hbox_label, concurrency])

periodic_commit_hbox_label = widgets.Label('Periodic Commit:',
layout=widgets.Layout(width=label_width,
display=periodic_commit_hbox_visibility,
justify_content="flex-end"))

periodic_commit_hbox = widgets.HBox([periodic_commit_hbox_label, periodic_commit])

poll_status_label = widgets.Label('Poll Load Status:',
layout=widgets.Layout(width=label_width,
display="flex",
Expand Down Expand Up @@ -2291,7 +2270,7 @@ def update_parserconfig_options(change):

basic_load_boxes = [source_hbox, source_format_hbox, region_hbox, fail_hbox]
# load arguments for Analytics incremental load
incremental_load_boxes = [concurrency_hbox, periodic_commit_hbox]
incremental_load_boxes = [concurrency_hbox]
# 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,
Expand All @@ -2314,7 +2293,6 @@ 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,)
periodic_commit_hbox.children = (periodic_commit_hbox_label, periodic_commit,)

validated = True
validation_label_style = DescriptionStyle(color='red')
Expand Down Expand Up @@ -2361,8 +2339,7 @@ def on_button_clicked(b):
incremental_load_kwargs = {
'source': source.value,
'format': source_format.value,
'concurrency': concurrency.value,
'periodicCommit': periodic_commit.value
'concurrency': concurrency.value
}
kwargs.update(incremental_load_kwargs)
else:
Expand Down Expand Up @@ -2406,7 +2383,6 @@ def on_button_clicked(b):
named_graph_uri_hbox.close()
base_uri_hbox.close()
concurrency_hbox.close()
periodic_commit_hbox.close()
button.close()

load_submit_status_output = widgets.Output()
Expand All @@ -2424,7 +2400,7 @@ def on_button_clicked(b):
else '"' + value + '"'
next_param = param + ': ' + value_substr
load_oc_params += next_param
if param == 'periodicCommit':
if param == 'concurrency':
load_oc_params += '}'
else:
load_oc_params += ', '
Expand Down

0 comments on commit 42f2f0c

Please sign in to comment.