Skip to content

Commit 7da0617

Browse files
authored
Fix NoneType serialization for OC query params (#584)
* Fix NoneType serialization for OC query params * update changelog
1 parent 2a8bdc1 commit 7da0617

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Starting with v1.31.6, this file will contain a record of major features and upd
1414
- Added `--store-format` option to query magics ([Link to PR](https://github.com/aws/graph-notebook/pull/580))
1515
- Added `--export-to` CSV file option to query magics ([Link to PR](https://github.com/aws/graph-notebook/pull/582))
1616
- Fixed unintended formatting in `%%oc explain` widget ([Link to PR](https://github.com/aws/graph-notebook/pull/576))
17+
- Fixed serialization of NoneType for `%%oc` query parameters ([Link to PR](https://github.com/aws/graph-notebook/pull/584))
1718
- Changed `%load` parameter and default value for failOnError ([Link to PR](https://github.com/aws/graph-notebook/pull/577))
1819

1920
## Release 4.1.0 (February 1, 2024)

src/graph_notebook/magics/graph_magic.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3097,10 +3097,11 @@ def handle_opencypher_query(self, line, cell, local_ns):
30973097
else:
30983098
query_params_input = args.query_parameters
30993099
if isinstance(query_params_input, dict):
3100-
query_params = query_params_input
3100+
query_params = json.dumps(query_params_input)
31013101
else:
31023102
try:
3103-
query_params = json.loads(query_params_input.replace("'", '"'))
3103+
query_params_dict = json.loads(query_params_input.replace("'", '"'))
3104+
query_params = json.dumps(query_params_dict)
31043105
except Exception as e:
31053106
print(f"Invalid query parameter input, ignoring.")
31063107

0 commit comments

Comments
 (0)