We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 00de09c + 6727bfd commit 9f74097Copy full SHA for 9f74097
2 files changed
src/GraphDataFrameBridge.jl
@@ -119,7 +119,7 @@ function metagraph_from_dataframe(graph_type,
119
edge_attributes = Vector{Symbol}([edge_attributes])
120
end
121
122
- origin_id = Symbol(start, :_id)
+ origin_id = Symbol(origin, :_id)
123
destination_id = Symbol(destination, :_id)
124
125
for e in edge_attributes
test/graphdataframebridge.jl
@@ -36,4 +36,21 @@ importall GraphDataFrameBridge
36
@test get_prop(mg, Edge(1, 2), :weight) == 1
37
@test get_prop(mg, Edge(4, 5), :weight) == 4
38
@test get_prop(mg, Edge(4, 5), :extras) == 8
39
+
40
41
+ # Test with different column names to ensure nothing name sensitive
42
+ df2 = DataFrame(Dict("alice" => ["a", "b", "a", "d"],
43
+ "bob" => ["b", "c", "e", "e"],
44
+ "weightz" => 1:4,
45
+ "extraz" => 5:8))
46
47
+ mg = MetaGraph(df2, :alice, :bob,
48
+ weight=:weightz,
49
+ edge_attributes=:extraz)
50
+ @test length(neighbors(mg, 2)) == 2
51
+ @test get_prop(mg, Edge(1, 2), :weight) == 1
52
+ @test get_prop(mg, Edge(4, 5), :weight) == 4
53
+ @test get_prop(mg, Edge(4, 5), :extraz) == 8
54
55
56
0 commit comments