diff --git a/README.md b/README.md index e106f7b..7ded88d 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ The accepted data types are: | IGNORE | This column will not be added to the graph | Optional | | DOUBLE / FLOAT | A signed 64-bit floating-point value | Yes | | INT / INTEGER / LONG | A signed 64-bit integer value | Yes | -| BOOL | A boolean value indicated by the string 'true' or 'false' | Yes | +| BOOL / BOOLEAN | A boolean value indicated by the string 'true' or 'false' | Yes | | STRING | A string value | Yes | | ARRAY | An array value | Yes | diff --git a/redisgraph_bulk_loader/entity_file.py b/redisgraph_bulk_loader/entity_file.py index 773daab..66f3495 100644 --- a/redisgraph_bulk_loader/entity_file.py +++ b/redisgraph_bulk_loader/entity_file.py @@ -14,6 +14,7 @@ class Type(Enum): UNKNOWN = 0 BOOL = 1 + BOOLEAN = 1 # alias to BOOL DOUBLE = 2 FLOAT = 2 # alias to DOUBLE STRING = 3 diff --git a/test/test_bulk_loader.py b/test/test_bulk_loader.py index 271c1e0..b7731c8 100644 --- a/test/test_bulk_loader.py +++ b/test/test_bulk_loader.py @@ -453,9 +453,9 @@ def test09_schema(self): graphname = "tmpgraph7" with open('/tmp/nodes.tmp', mode='w') as csv_file: out = csv.writer(csv_file) - out.writerow(['str_col:STRING', 'num_col:INT']) - out.writerow([0, 0]) - out.writerow([1, 1]) + out.writerow(['str_col:STRING', 'num_col:INT', 'bool_col:BOOLEAN']) + out.writerow([0, 0, True]) + out.writerow([1, 1, False]) runner = CliRunner() res = runner.invoke(bulk_insert, ['--nodes', '/tmp/nodes.tmp', @@ -466,9 +466,9 @@ def test09_schema(self): self.assertIn('2 nodes created', res.output) graph = Graph(graphname, self.redis_con) - query_result = graph.query('MATCH (a) RETURN a.str_col, a.num_col ORDER BY a.num_col') - expected_result = [['0', 0], - ['1', 1]] + query_result = graph.query('MATCH (a) RETURN a.str_col, a.num_col, a.bool_col ORDER BY a.num_col') + expected_result = [['0', 0, True], + ['1', 1, False]] # The graph should have the correct types for all properties self.assertEqual(query_result.result_set, expected_result)