Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
acquamarin committed May 24, 2023
1 parent 22bc64b commit 7c25d12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tools/python_api/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def init_tiny_snb(tmp_path):
"comments STRING[], MANY_MANY);")
conn.execute("COPY knows FROM \"../../../dataset/tinysnb/eKnows.csv\"")
conn.execute("create node table organisation (ID INT64, name STRING, orgCode INT64, mark DOUBLE, score INT64, "
"history STRING, licenseValidInterval INTERVAL, rating DOUBLE, PRIMARY KEY (ID))")
"history STRING,licenseValidInterval INTERVAL, rating DOUBLE, state STRUCT(revenue INT16, location "
"STRING[], stock STRUCT(price INT64[], volume INT64)), PRIMARY KEY (ID));")
conn.execute('COPY organisation FROM "../../../dataset/tinysnb/vOrganisation.csv"')
conn.execute('CREATE NODE TABLE movies (name STRING, length INT32, note STRING, description STRUCT(rating DOUBLE, '
'views INT64, release TIMESTAMP, film DATE), PRIMARY KEY (name))')
Expand Down
5 changes: 3 additions & 2 deletions tools/python_api/test/test_torch_geometric.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def test_to_torch_geometric_heterogeneous_graph(establish_connection):
with warnings.catch_warnings(record=True) as ws:
torch_geometric_data, pos_to_idx, unconverted_properties, edge_properties = res.get_as_torch_geometric()

assert len(ws) == 10
assert len(ws) == 11
warnings_ground_truth = set([
"Property organisation.name of type STRING is not supported by torch_geometric. The property is marked as unconverted.",
"Property person.height of type FLOAT is not supported by torch_geometric. The property is marked as unconverted.",
Expand All @@ -230,6 +230,7 @@ def test_to_torch_geometric_heterogeneous_graph(establish_connection):
"Property organisation.history of type STRING is not supported by torch_geometric. The property is marked as unconverted.",
"Property person.usedNames of type STRING is not supported by torch_geometric. The property is marked as unconverted.",
"Property organisation.licenseValidInterval of type INTERVAL is not supported by torch_geometric. The property is marked as unconverted.",
"Property organisation.state of type STRUCT(INT16,STRING is not supported by torch_geometric. The property is marked as unconverted."
])

for w in ws:
Expand Down Expand Up @@ -359,7 +360,7 @@ def test_to_torch_geometric_heterogeneous_graph(establish_connection):
]['rating'] - torch_geometric_data['organisation'].rating[i].item() < 1e-6

assert 'organisation' in unconverted_properties
assert len(unconverted_properties['organisation']) == 3
assert len(unconverted_properties['organisation']) == 4
assert 'name' in unconverted_properties['organisation']
for i in range(2):
assert ground_truth.TINY_SNB_ORGANISATIONS_GROUND_TRUTH[pos_to_idx['organisation'][i]
Expand Down

0 comments on commit 7c25d12

Please sign in to comment.