Created
December 7, 2025 03:01
-
-
Save rjurney/af80c8f70b0a7c61aac53f44f7de0eec to your computer and use it in GitHub Desktop.
Error when visualizing a DataFrame of edges
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HTTPError | |
| 422 Client Error: Unprocessable Entity for url: https://hub.graphistry.com/api/v2/upload/datasets/299b11a0c59741db86d40613c1269cf8/nodes/arrow | |
| See the console area for a traceback. | |
| Traceback (most recent call last): | |
| File "/Users/rjurney/anaconda3/envs/weave/lib/python3.12/site-packages/marimo/_runtime/executor.py", line 139, in execute_cell | |
| return eval(cell.last_expr, glbls) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| Cell | |
| marimo:///Users/rjurney/Software/weave/notebooks/graph.py#cell=cell-11 | |
| , line 24, in <module> | |
| g.plot(G) | |
| File "/Users/rjurney/anaconda3/envs/weave/lib/python3.12/site-packages/graphistry/PlotterBase.py", line 1576, in plot | |
| dataset.post(as_files=as_files, memoize=memoize, validate=validate, erase_files_on_fail=erase_files_on_fail) | |
| File "/Users/rjurney/anaconda3/envs/weave/lib/python3.12/site-packages/graphistry/arrow_uploader.py", line 582, in post | |
| self.post_nodes_arrow() | |
| File "/Users/rjurney/anaconda3/envs/weave/lib/python3.12/site-packages/graphistry/arrow_uploader.py", line 699, in post_nodes_arrow | |
| return self.post_arrow(arr, 'nodes', opts) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| File "/Users/rjurney/anaconda3/envs/weave/lib/python3.12/site-packages/graphistry/arrow_uploader.py", line 716, in post_arrow | |
| raise e | |
| File "/Users/rjurney/anaconda3/envs/weave/lib/python3.12/site-packages/graphistry/arrow_uploader.py", line 707, in post_arrow | |
| resp = self.post_arrow_generic(sub_path, tok, arr, opts) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| File "/Users/rjurney/anaconda3/envs/weave/lib/python3.12/site-packages/graphistry/arrow_uploader.py", line 739, in post_arrow_generic | |
| resp.raise_for_status() | |
| File "/Users/rjurney/anaconda3/envs/weave/lib/python3.12/site-packages/requests/models.py", line 1026, in raise_for_status | |
| raise HTTPError(http_error_msg, response=self) | |
| requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://hub.graphistry.com/api/v2/upload/datasets/299b11a0c59741db86d40613c1269cf8/nodes/arrow | |
| Fix with AI | |
| Launch debugger | |
| Get help | |
| Failed memoization speedup attempt due to Pandas internal hash function failing. Continuing without memoization speedups.This is fine, but for speedups around skipping re-uploads of previously seen tables, try identifying which columns have types that Pandas cannot hash, and convert them to hashable types like strings.HTTP 422 error - response content (JSON): { | |
| "data": { | |
| "bindings": { | |
| "node": "id", | |
| "node_label": "name", | |
| "node_title": "name" | |
| }, | |
| "dataset_id": "299b11a0c59741db86d40613c1269cf8", | |
| "error_message": "Node binding 'node_label' to a column named 'name' that does not exist, is there a typo in the column name?" | |
| }, | |
| "message": "Invalid nodes bindings", | |
| "success": false | |
| }HTTP 422 error - response content (JSON): { | |
| "data": { | |
| "bindings": { | |
| "node": "id", | |
| "node_label": "name", | |
| "node_title": "name" | |
| }, | |
| "dataset_id": "299b11a0c59741db86d40613c1269cf8", | |
| "error_message": "Node binding 'node_label' to a column named 'name' that does not exist, is there a typo in the column name?" | |
| }, | |
| "message": "Invalid nodes bindings", | |
| "success": false | |
| }Failed to post arrow to api/v2/upload/datasets/299b11a0c59741db86d40613c1269cf8/nodes/arrow (https://hub.graphistry.com/api/v2/upload/datasets/299b11a0c59741db86d40613c1269cf8/nodes/arrow) | |
| Traceback (most recent call last): | |
| File "/Users/rjurney/anaconda3/envs/weave/lib/python3.12/site-packages/graphistry/arrow_uploader.py", line 707, in post_arrow | |
| resp = self.post_arrow_generic(sub_path, tok, arr, opts) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| File "/Users/rjurney/anaconda3/envs/weave/lib/python3.12/site-packages/graphistry/arrow_uploader.py", line 739, in post_arrow_generic | |
| resp.raise_for_status() | |
| File "/Users/rjurney/anaconda3/envs/weave/lib/python3.12/site-packages/requests/models.py", line 1026, in raise_for_status | |
| raise HTTPError(http_error_msg, response=self) | |
| requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://hub.graphistry.com/api/v2/upload/datasets/299b11a0c59741db86d40613c1269cf8/nodes/arrow422 Client Error: Unprocessable Entity for url: https://hub.graphistry.com/api/v2/upload/datasets/299b11a0c59741db86d40613c1269cf8/nodes/arrowNone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 1. Create a map `uuid_to_int`. | |
| all_uuids = pd.concat([node_df["uuid"], edge_df["src"], edge_df["dst"]]).unique() | |
| uuid_to_int = {uuid: i for i, uuid in enumerate(all_uuids)} | |
| # Add an integer ID to the company dataframe | |
| node_df["id"] = node_df["uuid"].map(uuid_to_int) | |
| # Replace src and dst in edge_df with integer IDs | |
| edge_df["src"] = edge_df["src"].map(uuid_to_int) | |
| edge_df["dst"] = edge_df["dst"].map(uuid_to_int) | |
| # 2. Create the graph with integer IDs | |
| G = nx.from_pandas_edgelist(edge_df, source="src", target="dst", edge_attr=True, create_using=nx.DiGraph()) | |
| # Add nodes with attributes from the company dataframe | |
| node_attributes_pre_df = node_df[["id", "name", "description"]] | |
| node_attributes_df = node_attributes_pre_df["id"].notnull() | |
| node_attributes_df = node_attributes_pre_df.set_index("id") | |
| node_attributes_df.fillna("UNKNOWN") | |
| node_attributes = node_attributes_df.to_dict("index") | |
| nx.set_node_attributes(G, node_attributes) | |
| g = ( | |
| graphistry.bind( | |
| source="src", | |
| destination="dst", | |
| node="id", | |
| point_title="name", | |
| point_label="name", | |
| ) | |
| .scene_settings( | |
| edge_opacity=0.4, | |
| ) | |
| .addStyle( | |
| page={ | |
| "title": "Time Period Sample", | |
| "favicon": FAVICON_URL, | |
| }, | |
| logo=LOGO, | |
| ) | |
| .settings( | |
| url_params=GRAPHISTRY_PARAMS, | |
| height=800, | |
| ) | |
| ) | |
| g.plot(G) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment