Unverified Commit b87e3902 authored by Junda Yang's avatar Junda Yang Committed by GitHub

unquote boolean value is_view when publish to neo4j (#28)

* unquote bool value is_view when publish to neo4j

* fix test
parent d8a27343
......@@ -5,6 +5,7 @@ from typing import Iterable, Any, Union, Iterator, Dict, Set # noqa: F401
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'
......@@ -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'
......
from setuptools import setup, find_packages
__version__ = '1.0.10'
__version__ = '1.0.11'
setup(
......
......@@ -24,7 +24,8 @@ class TestTableMetadata(unittest.TestCase):
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',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment