Commit 1bd6cd5c authored by Dave Cameron's avatar Dave Cameron Committed by Tao Feng

In Progress: Mark sort_order col so Publisher leaves unquoted. (#160)

* Mark sort_order col so Publisher leaves unquoted.

* Add UNQUOTED for sort_order to unit tests.

* Shorter lines for the flake8.
parent 6ca972b9
...@@ -36,7 +36,7 @@ class ColumnMetadata: ...@@ -36,7 +36,7 @@ class ColumnMetadata:
COLUMN_KEY_FORMAT = '{db}://{cluster}.{schema}/{tbl}/{col}' COLUMN_KEY_FORMAT = '{db}://{cluster}.{schema}/{tbl}/{col}'
COLUMN_NAME = 'name' COLUMN_NAME = 'name'
COLUMN_TYPE = 'type' COLUMN_TYPE = 'type'
COLUMN_ORDER = 'sort_order' COLUMN_ORDER = 'sort_order{}'.format(UNQUOTED_SUFFIX) # int value needs to be unquoted when publish to neo4j
COLUMN_DESCRIPTION = 'description' COLUMN_DESCRIPTION = 'description'
COLUMN_DESCRIPTION_FORMAT = '{db}://{cluster}.{schema}/{tbl}/{col}/_description' COLUMN_DESCRIPTION_FORMAT = '{db}://{cluster}.{schema}/{tbl}/{col}/_description'
......
...@@ -32,26 +32,26 @@ class TestTableMetadata(unittest.TestCase): ...@@ -32,26 +32,26 @@ class TestTableMetadata(unittest.TestCase):
'is_view:UNQUOTED': False}, 'is_view:UNQUOTED': False},
{'description': 'test_table1', 'KEY': 'hive://gold.test_schema1/test_table1/_description', {'description': 'test_table1', 'KEY': 'hive://gold.test_schema1/test_table1/_description',
'LABEL': 'Description'}, 'LABEL': 'Description'},
{'sort_order': 0, 'type': 'bigint', 'name': 'test_id1', {'sort_order:UNQUOTED': 0, 'type': 'bigint', 'name': 'test_id1',
'KEY': 'hive://gold.test_schema1/test_table1/test_id1', 'LABEL': 'Column'}, 'KEY': 'hive://gold.test_schema1/test_table1/test_id1', 'LABEL': 'Column'},
{'description': 'description of test_table1', {'description': 'description of test_table1',
'KEY': 'hive://gold.test_schema1/test_table1/test_id1/_description', 'LABEL': 'Description'}, 'KEY': 'hive://gold.test_schema1/test_table1/test_id1/_description', 'LABEL': 'Description'},
{'sort_order': 1, 'type': 'bigint', 'name': 'test_id2', {'sort_order:UNQUOTED': 1, 'type': 'bigint', 'name': 'test_id2',
'KEY': 'hive://gold.test_schema1/test_table1/test_id2', 'LABEL': 'Column'}, 'KEY': 'hive://gold.test_schema1/test_table1/test_id2', 'LABEL': 'Column'},
{'description': 'description of test_id2', {'description': 'description of test_id2',
'KEY': 'hive://gold.test_schema1/test_table1/test_id2/_description', 'LABEL': 'Description'}, 'KEY': 'hive://gold.test_schema1/test_table1/test_id2/_description', 'LABEL': 'Description'},
{'sort_order': 2, 'type': 'boolean', 'name': 'is_active', {'sort_order:UNQUOTED': 2, 'type': 'boolean', 'name': 'is_active',
'KEY': 'hive://gold.test_schema1/test_table1/is_active', 'LABEL': 'Column'}, 'KEY': 'hive://gold.test_schema1/test_table1/is_active', 'LABEL': 'Column'},
{'sort_order': 3, 'type': 'varchar', 'name': 'source', 'KEY': 'hive://gold.test_schema1/test_table1/source', {'sort_order:UNQUOTED': 3, 'type': 'varchar', 'name': 'source',
'LABEL': 'Column'}, 'KEY': 'hive://gold.test_schema1/test_table1/source', 'LABEL': 'Column'},
{'description': 'description of source', 'KEY': 'hive://gold.test_schema1/test_table1/source/_description', {'description': 'description of source', 'KEY': 'hive://gold.test_schema1/test_table1/source/_description',
'LABEL': 'Description'}, 'LABEL': 'Description'},
{'sort_order': 4, 'type': 'timestamp', 'name': 'etl_created_at', {'sort_order:UNQUOTED': 4, 'type': 'timestamp', 'name': 'etl_created_at',
'KEY': 'hive://gold.test_schema1/test_table1/etl_created_at', 'LABEL': 'Column'}, 'KEY': 'hive://gold.test_schema1/test_table1/etl_created_at', 'LABEL': 'Column'},
{'description': 'description of etl_created_at', {'description': 'description of etl_created_at',
'KEY': 'hive://gold.test_schema1/test_table1/etl_created_at/_description', 'LABEL': 'Description'}, 'KEY': 'hive://gold.test_schema1/test_table1/etl_created_at/_description', 'LABEL': 'Description'},
{'sort_order': 5, 'type': 'varchar', 'name': 'ds', 'KEY': 'hive://gold.test_schema1/test_table1/ds', {'sort_order:UNQUOTED': 5, 'type': 'varchar', 'name': 'ds',
'LABEL': 'Column'} 'KEY': 'hive://gold.test_schema1/test_table1/ds', 'LABEL': 'Column'}
] ]
self.expected_nodes = copy.deepcopy(self.expected_nodes_deduped) self.expected_nodes = copy.deepcopy(self.expected_nodes_deduped)
......
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