summaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools/transforms.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-12-24 15:17:25 -0800
committerBryan Newbold <bnewbold@robocracy.org>2018-12-24 15:17:25 -0800
commit24ab203a00354f768fc48e0786b21de4afcd9c4a (patch)
tree7c5305dafc110fb58e0ab323ba8b58c1f61914ba /python/fatcat_tools/transforms.py
parentd7a4e4649e1da2c02ec8472173c79f7c708ce19b (diff)
downloadfatcat-24ab203a00354f768fc48e0786b21de4afcd9c4a.tar.gz
fatcat-24ab203a00354f768fc48e0786b21de4afcd9c4a.zip
implement release_year (and rustfmt)
Diffstat (limited to 'python/fatcat_tools/transforms.py')
-rw-r--r--python/fatcat_tools/transforms.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/fatcat_tools/transforms.py b/python/fatcat_tools/transforms.py
index 516b68ae..843c00a5 100644
--- a/python/fatcat_tools/transforms.py
+++ b/python/fatcat_tools/transforms.py
@@ -48,6 +48,10 @@ def release_to_elasticsearch(release):
if release.release_date:
# .isoformat() results in, eg, '2010-10-22' (YYYY-MM-DD)
t['release_date'] = release.release_date.isoformat()
+ if release.release_year is None:
+ t['release_year'] = release.release_date.year
+ if release.release_year is not None:
+ t['release_year'] = release.release_year
container = release.container
container_is_kept = False