Skip to content

Commit

Permalink
unquote boolean value is_view when publish to neo4j (#28)
Browse files Browse the repository at this point in the history
* unquote bool value is_view when publish to neo4j

* fix test
  • Loading branch information
youngyjd authored Apr 25, 2019
1 parent d8a2734 commit b87e390
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion databuilder/models/table_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from databuilder.models.neo4j_csv_serde import (
Neo4jCsvSerializable, NODE_LABEL, NODE_KEY, RELATION_START_KEY, RELATION_END_KEY, RELATION_START_LABEL,
RELATION_END_LABEL, RELATION_TYPE, RELATION_REVERSE_TYPE)
from databuilder.publisher.neo4j_csv_publisher import UNQUOTED_SUFFIX

DESCRIPTION_NODE_LABEL = 'Description'

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

TABLE_DESCRIPTION = 'description'
TABLE_DESCRIPTION_FORMAT = '{db}://{cluster}.{schema}/{tbl}/_description'
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages


__version__ = '1.0.10'
__version__ = '1.0.11'


setup(
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/models/test_table_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def setUp(self):
ColumnMetadata('ds', None, 'varchar', 5)])

self.expected_nodes_deduped = [
{'name': 'test_table1', 'KEY': 'hive://gold.test_schema1/test_table1', 'LABEL': 'Table', 'is_view': False},
{'name': 'test_table1', 'KEY': 'hive://gold.test_schema1/test_table1', 'LABEL': 'Table',
'is_view:UNQUOTED': False},
{'description': 'test_table1', 'KEY': 'hive://gold.test_schema1/test_table1/_description',
'LABEL': 'Description'},
{'sort_order': 0, 'type': 'bigint', 'name': 'test_id1',
Expand Down

0 comments on commit b87e390

Please sign in to comment.