Skip to content

Commit

Permalink
[AMD-149] Add updated timestamp into node and relation (#82)
Browse files Browse the repository at this point in the history
* [AMD-149] Add updated timestamp into node and relation

* Update
  • Loading branch information
jinhyukchang authored Jun 6, 2019
1 parent 63ebe14 commit e2e6441
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions databuilder/databuilder/publisher/neo4j_csv_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
# Neo4j property name for published tag
PUBLISHED_TAG_PROPERTY_NAME = 'published_tag'

# Neo4j property name for last updated timestamp
LAST_UPDATED_EPOCH_MS = 'publisher_last_updated_epoch_ms'

RELATION_PREPROCESSOR = 'relation_preprocessor'

# CSV HEADER
Expand Down Expand Up @@ -385,6 +388,10 @@ def _create_props_body(self,
key=PUBLISHED_TAG_PROPERTY_NAME,
val=self.publish_tag))

props.append("""{id}.{key} = {val}""".format(id=identifier,
key=LAST_UPDATED_EPOCH_MS,
val='timestamp()'))

return ', '.join(props)

def _execute_statement(self,
Expand All @@ -403,6 +410,7 @@ def _execute_statement(self,
:param expect_result: By having this True, it will validate if result object is not None.
:return:
"""
LOGGER.info('Executing statement: {} with params {}'.format(stmt, params))
try:
if LOGGER.isEnabledFor(logging.DEBUG):
LOGGER.debug('Executing statement: {} with params {}'.format(stmt, params))
Expand Down
2 changes: 1 addition & 1 deletion databuilder/setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages


__version__ = '1.2.7'
__version__ = '1.2.8'


setup(
Expand Down

0 comments on commit e2e6441

Please sign in to comment.