summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-04-06 20:25:46 -0700
committerBryan Newbold <bnewbold@robocracy.org>2021-04-06 21:58:54 -0700
commit5ba1859a2308c72e7e3e4e86af3c275210c5bacd (patch)
treeaf52123cb959a2262f8bcbf8a2e1349b6db2d919 /python
parent261c85ca450f4bb8bc6956e719d7c276927dcd95 (diff)
downloadfatcat-5ba1859a2308c72e7e3e4e86af3c275210c5bacd.tar.gz
fatcat-5ba1859a2308c72e7e3e4e86af3c275210c5bacd.zip
ES schema updates: doc_index_ts as a str, not datetime
The schema is a timestamp, but python needs to serialize as JSON, and doesn't do datetime automatically.
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_tools/transforms/elasticsearch.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/fatcat_tools/transforms/elasticsearch.py b/python/fatcat_tools/transforms/elasticsearch.py
index fe463fa4..4bf9091a 100644
--- a/python/fatcat_tools/transforms/elasticsearch.py
+++ b/python/fatcat_tools/transforms/elasticsearch.py
@@ -46,7 +46,7 @@ def release_to_elasticsearch(entity: ReleaseEntity, force_bool: bool = True) ->
# First, the easy ones (direct copy)
release = entity
t = dict(
- doc_index_ts=datetime.datetime.utcnow(),
+ doc_index_ts=datetime.datetime.utcnow().isoformat()+"Z",
ident = release.ident,
state = release.state,
revision = release.revision,
@@ -395,7 +395,7 @@ def container_to_elasticsearch(entity, force_bool=True, stats=None):
# First, the easy ones (direct copy)
t = dict(
- doc_index_ts=datetime.datetime.utcnow(),
+ doc_index_ts=datetime.datetime.utcnow().isoformat()+"Z",
ident = entity.ident,
state = entity.state,
revision = entity.revision,
@@ -515,7 +515,7 @@ def changelog_to_elasticsearch(entity):
editgroup = entity.editgroup
t = dict(
- doc_index_ts=datetime.datetime.utcnow(),
+ doc_index_ts=datetime.datetime.utcnow().isoformat()+"Z",
index=entity.index,
editgroup_id=entity.editgroup_id,
timestamp=entity.timestamp.isoformat(),
@@ -579,7 +579,7 @@ def file_to_elasticsearch(entity):
# First, the easy ones (direct copy)
t = dict(
- doc_index_ts=datetime.datetime.utcnow(),
+ doc_index_ts=datetime.datetime.utcnow().isoformat()+"Z",
ident = entity.ident,
state = entity.state,
revision = entity.revision,