Open maweijiao opened 1 month ago
@maweijiao Hi, I am facing the same issue. Pls let me know if you have any update on this. Thanks
@maweijiao @hungbui-io I guess the two lines is enough:
%ngql MATCH (p:entity)-[e:relationship]->(m:entity) WHERE p.entity.name == '迈克尔·鲁克' RETURN p,e,m
%ng_draw
No need to config anything
Sorry I missed this issue.
The ngdraw command can be done only after the query being done, a 'df=' call will interrupt the context needed for ng_draw.
Could you do ng_draw follow the ngql one by one? This should work.
The df = _ could be evaluated with another ngql call.
We can add feature to draw from a df later to improve this later.
Also, now ng_draw will be working with both result formats in latest release.
Hi @wey-gu . I am still facing the issue...Any idea?
Hi @wey-gu . I am still facing the issue...Any idea?
Dear @hungbui-io
Would you mind helping perform pip install -U this package to see how it goes with latest version?
As from your backtrack, it's shown with an older version and in the current release, I make it try to cast other styles of output into pd df.
The original version of my installation package was 0.12.4. After I upgraded this installation package, it still reported an error if I did not set “IPythonNGQL.ngql_result_style=“pandas””. After setting it, it can be displayed normally.
After setting it, it can be displayed normally.
-U
Hi @wey-gu, thanks for your support. I have updated the package to 0.13.1, and here is the new error.
[ERROR]: the last execution result is not a %ngql query, make a query first or use %ng_draw <some query> instead, please. Something wrong with the result parsing: { "Nodes": [ "Access key", "Anonymized completely", "Access key value", "Auto-populates in anonymized format - *****", "In anonymized format", "Actian avalanche", "Inputs according to actian's connection support", "Data warehouse", "Action", "View details and delete", "Delete button", "Edit button", "Action column", "Right side", "Publish icon", "Re-run button", "Actions column", "Edit", "Add", "Adding filled details", "Add button", "Particular rule detail and display it in a table below", ... "Heading": "" } Error: 'Network' object has no attribute 'keys'
Dear @hungbui-io @maweijiao ,
The latest release I just made 0.13.2 should fix the above issues:
Kindly help verify your use case when possible, thanks!!
@wey-gu Thanks!When I upgraded, there was an error, regardless of whether I set ‘IPythonNGQL.ngql_result_style=“pandas”’.
@maweijiao thanks a lot for the test! Could you please help share what queries are you using to trigger such error? And/or any queries will end up such error? As I cannot reproduce it in my env.
@maweijiao I had tried different types of queries and render with %ng_draw
, all run perfectly.
%ngql GET SUBGRAPH 2 STEPS WITH PROP FROM "p_0" YIELD VERTICES AS nodes, EDGES AS relationships;
%%ngql
MATCH path_0=(n)--() WHERE id(n) == "p_0"
OPTIONAL MATCH path_1=(n)--()--()
RETURN path_0, path_1
%%ngql
MATCH (n)-[e]-(m) WHERE id(n) == "p_0"
OPTIONAL MATCH (n)-[e1]-(a)-[e2]-(b)
RETURN n,m,e,e1,e2,a,b
%ngql FIND ALL PATH WITH PROP FROM "p_5703" TO "p_5742" OVER * BIDIRECT YIELD path AS p;
%config IPythonNGQL.ngql_result_style="pandas"
%ngql MATCH (p:
entity
)-[e:relationship]->(m:entity
) WHERE p.entity
.name
== '迈克尔·鲁克' RETURN p,e,m %ng_drawAssertionError Traceback (most recent call last) Input In [14], in <cell line: 1>() ----> 1 get_ipython().run_line_magic('ng_draw', '')
File D:\P\anaconda3\lib\site-packages\IPython\core\interactiveshell.py:2294, in InteractiveShell.run_line_magic(self, magic_name, line, _stack_depth) 2292 kwargs['local_ns'] = self.get_local_scope(stack_depth) 2293 with self.builtin_trap: -> 2294 result = fn(*args, **kwargs) 2295 return result
File D:\P\anaconda3\lib\site-packages\ngql\magic.py:378, in IPythonNGQL.ng_draw(self, line, cell, local_ns) 376 return "No result found, please execute a query first." 377 result_df = local_ns[variable_name] --> 378 assert isinstance( 379 result_df, pd.DataFrame 380 ), "Result is not in Pandas DataFrame Style" 382 # Create a graph 383 g = Network( 384 notebook=True, 385 directed=True, (...) 391 neighborhood_highlight=True, 392 )
AssertionError: Result is not in Pandas DataFrame Style
不太清楚问题出在了哪里,谢谢~