Skip to content
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

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

Open
DataBoyTX opened this issue Nov 20, 2024 · 4 comments
Open
Assignees
Labels

Comments

@DataBoyTX
Copy link
Contributor

DataBoyTX commented Nov 20, 2024

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 DataBoyTX added the bug label Nov 20, 2024
@lmeyerov
Copy link
Contributor

@DataBoyTX any way to know if they have additional surprisingly named columns? we don't assume hard-coded names, so the issue is generally excess results, not missing...

@DataBoyTX
Copy link
Contributor Author

@lmeyerov - I am not sure what you mean by surprisingly named columns, the column names that don't work are: parent_elid for src ID and elid for dest ID, that returns 0 results, but using src and dest IDs named src and dest does work.

Also curious what you mean by we don't assume hard-coded names?

@lmeyerov
Copy link
Contributor

lmeyerov commented Nov 26, 2024

elid is not a variable name in this repo so I don't know why it would collide, so I'm wondering if their data has more columns , and the bug report does not provide the full schema

@DataBoyTX
Copy link
Contributor Author

@lmeyerov - sorry I missed this comment. I added the link to the dataset above a few weeks ago, there's elid in both the files, and the source code (renamed to src/dest for the edges to show that it works), but it's definitely there.

data file (also in description above): link

$  ls -lh
total 548K
-rwxrwxrwx 1 root root 118K Dec 10 00:58 blueprint_edges.csv
-rwxrwxrwx 1 root root 426K Dec 10 00:58 blueprint_nodes.csv

$  head -n 1 *
==> blueprint_edges.csv <==
elid,parent_elid,depth,bottom_flag,top_flag

==> blueprint_nodes.csv <==
elid,ui_role,bottom_flag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants