Skip to content

Commit 795d7a8

Browse files
authored
Add error messaging for incompatible host-specific config params (#456)
* Add error messaging for incompatible host-specific config params * update changelog --------- Co-authored-by: Michael Chin <chnmch@amazon.com>
1 parent f0b61da commit 795d7a8

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Starting with v1.31.6, this file will contain a record of major features and upd
66
- New Neptune ML notebook - Real Time Fraud Detection using Inductive Inference ([Link to PR](https://github.com/aws/graph-notebook/pull/338))
77
- Path: 04-Machine-Learning > Sample-Applications > 03-Real-Time-Fraud-Detection-Using-Inductive-Inference.ipynb
88
- Added `--profile-misc-args` option to `%%gremlin` ([Link to PR](https://github.com/aws/graph-notebook/pull/443))
9+
- Added error messaging for incompatible host-specific `%%graph_notebok_config` parameters ([Link to PR](https://github.com/aws/graph-notebook/pull/456))
910
- Ensure default assignments for all Gremlin nodes when using grouping ([Link to PR](https://github.com/aws/graph-notebook/pull/448))
1011

1112
## Release 3.7.1 (January 25, 2023)

src/graph_notebook/configuration/get_config.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from graph_notebook.neptune.client import NEPTUNE_CONFIG_HOST_IDENTIFIERS, is_allowed_neptune_host, false_str_variants, \
1111
DEFAULT_NEO4J_USERNAME, DEFAULT_NEO4J_PASSWORD, DEFAULT_NEO4J_DATABASE
1212

13+
neptune_params = ['auth_mode', 'load_from_s3_arn', 'aws_region']
1314

1415
def get_config_from_dict(data: dict, neptune_hosts: list = NEPTUNE_CONFIG_HOST_IDENTIFIERS) -> Configuration:
1516

@@ -39,6 +40,14 @@ def get_config_from_dict(data: dict, neptune_hosts: list = NEPTUNE_CONFIG_HOST_I
3940
gremlin_section=gremlin_section, neo4j_section=neo4j_section,
4041
proxy_host=proxy_host, proxy_port=proxy_port, neptune_hosts=neptune_hosts)
4142
else:
43+
excluded_params = []
44+
for p in neptune_params:
45+
if p in data:
46+
excluded_params.append(p)
47+
if excluded_params:
48+
print(f"The provided configuration contains the following parameters that are incompatible with the "
49+
f"specified host: {str(excluded_params)}. These parameters have not been saved.\n")
50+
4251
config = Configuration(host=data['host'], port=data['port'], ssl=data['ssl'], ssl_verify=ssl_verify,
4352
sparql_section=sparql_section, gremlin_section=gremlin_section, neo4j_section=neo4j_section,
4453
proxy_host=proxy_host, proxy_port=proxy_port)

0 commit comments

Comments
 (0)