Skip to content

Fixed formatting in openCypher explain widget #576

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Starting with v1.31.6, this file will contain a record of major features and upd
- Added `@neptune_graph_only` magics decorator ([Link to PR](https://github.com/aws/graph-notebook/pull/569))
- Added `%graph_pg_info` line magic ([Link to PR](https://github.com/aws/graph-notebook/pull/570))
- Added documentation for FontAwesome 5 settings ([Link to PR](https://github.com/aws/graph-notebook/pull/575))
- Fixed unintended formatting in `%%oc explain` widget ([Link to PR](https://github.com/aws/graph-notebook/pull/576))

## Release 4.1.0 (February 1, 2024)
- New Neptune Analytics notebook - Vector Similarity Algorithms ([Link to PR](https://github.com/aws/graph-notebook/pull/555))
Expand Down
8 changes: 5 additions & 3 deletions src/graph_notebook/magics/graph_magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3020,9 +3020,10 @@ def handle_opencypher_query(self, line, cell, local_ns):
res = self.client.opencypher_http(cell, explain=args.explain_type, query_params=query_params,
plan_cache=args.plan_cache)
query_time = time.time() * 1000 - query_start
explain = res.content.decode("utf-8")
res_replace_chars = res.content.replace(b'$', b'\$')
explain = res_replace_chars.decode("utf-8")
res.raise_for_status()
##store_to_ns(args.store_to, explain, local_ns)
store_to_ns(args.store_to, explain, local_ns)
if not args.silent:
oc_metadata = build_opencypher_metadata_from_query(query_type='explain', results=None,
results_type='explain', res=res,
Expand Down Expand Up @@ -3153,7 +3154,8 @@ def handle_opencypher_query(self, line, cell, local_ns):
with first_tab_output:
display(HTML(first_tab_html))

store_to_ns(args.store_to, res, local_ns)
if args.mode != 'explain':
store_to_ns(args.store_to, res, local_ns)

def handle_opencypher_status(self, line, local_ns):
"""
Expand Down
Loading