pygraphistry icon indicating copy to clipboard operation
pygraphistry copied to clipboard

e_forward() not returning results without IDs named 'src' and 'dest'

Open DataBoyTX opened this issue 1 year ago • 7 comments

Describe the bug

Customer reported bug with GFQL's e_forward() not returning the correct results unless the edge df IDs are named 'src' and 'dest'

To Reproduce

import graphistry
import pandas as pd
from graphistry import (
    # graph operators
    n, e_undirected, e_forward, e_reverse, e,
    # attribute predicates
    is_in, ge, startswith, contains, match as match_re
)
import pandas as pd

graphistry.register(...)

edges_df = pd.read_csv('blueprint_edges.csv')
nodes_df = pd.read_csv('blueprint_nodes.csv')

edges_df['src'] = edges_df['parent_elid']
edges_df['dest'] = edges_df['elid']

# create two different graphs with the same cols, just named differently: 
g = graphistry.edges(edges_df, 'parent_elid', 'elid').nodes(nodes_df, 'elid') 
g2 = graphistry.edges(edges_df, 'src', 'dest').nodes(nodes_df, 'elid') 

# Test: 
# expected behavior: be able to use e_forward to get edges
# observed behavior: get no edges back unless using e() or e_undirected()
def test_eforward(g):
    guc = g.chain([
        n({"elid":"905e3174aa"}),
        e_forward(),
        n()
    ])

    print('nodes:\n', guc._nodes, '\n' )
    print('edges:\n', guc._edges)


test_eforward(g)
test_eforward(g2)

# notice that the first call with 'g' does not return any edges, where the call with 'g2' does 

blueprint_nodes.zip

Expected behavior

be able to use e_forward to get edges

Actual behavior

get no edges back unless using e() or e_undirected(), or change the IDs to src and dest

Screenshot showing differences of counts with same column contents for IDs, but different names:

image

Graphistry GPU server environment

Hub v2.41.10

PyGraphistry API client environment

  • Where run Jupyter Lab local
  • Version 0.34.17
  • Python Version Python 3.8.5

DataBoyTX avatar Nov 20 '24 18:11 DataBoyTX