Skip to content

Commit b87e390

Browse files
authored
unquote boolean value is_view when publish to neo4j (#28)
* unquote bool value is_view when publish to neo4j * fix test
1 parent d8a2734 commit b87e390

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

databuilder/models/table_metadata.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from databuilder.models.neo4j_csv_serde import (
66
Neo4jCsvSerializable, NODE_LABEL, NODE_KEY, RELATION_START_KEY, RELATION_END_KEY, RELATION_START_LABEL,
77
RELATION_END_LABEL, RELATION_TYPE, RELATION_REVERSE_TYPE)
8+
from databuilder.publisher.neo4j_csv_publisher import UNQUOTED_SUFFIX
89

910
DESCRIPTION_NODE_LABEL = 'Description'
1011

@@ -68,7 +69,7 @@ class TableMetadata(Neo4jCsvSerializable):
6869
TABLE_NODE_LABEL = 'Table'
6970
TABLE_KEY_FORMAT = '{db}://{cluster}.{schema}/{tbl}'
7071
TABLE_NAME = 'name'
71-
IS_VIEW = 'is_view'
72+
IS_VIEW = 'is_view{}'.format(UNQUOTED_SUFFIX) # bool value needs to be unquoted when publish to neo4j
7273

7374
TABLE_DESCRIPTION = 'description'
7475
TABLE_DESCRIPTION_FORMAT = '{db}://{cluster}.{schema}/{tbl}/_description'

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from setuptools import setup, find_packages
22

33

4-
__version__ = '1.0.10'
4+
__version__ = '1.0.11'
55

66

77
setup(

tests/unit/models/test_table_metadata.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ def setUp(self):
2424
ColumnMetadata('ds', None, 'varchar', 5)])
2525

2626
self.expected_nodes_deduped = [
27-
{'name': 'test_table1', 'KEY': 'hive://gold.test_schema1/test_table1', 'LABEL': 'Table', 'is_view': False},
27+
{'name': 'test_table1', 'KEY': 'hive://gold.test_schema1/test_table1', 'LABEL': 'Table',
28+
'is_view:UNQUOTED': False},
2829
{'description': 'test_table1', 'KEY': 'hive://gold.test_schema1/test_table1/_description',
2930
'LABEL': 'Description'},
3031
{'sort_order': 0, 'type': 'bigint', 'name': 'test_id1',

0 commit comments

Comments
 (0)