From ff7bc394943707e3de75fc79e42a3b43bc9c95cb Mon Sep 17 00:00:00 2001
From: Daniel <d.hornung@indiscale.com>
Date: Thu, 13 Jun 2024 16:16:36 +0200
Subject: [PATCH] FIX: Also work with dates in SPSS files.

---
 src/caoscrawler/conv_impl/spss.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/caoscrawler/conv_impl/spss.py b/src/caoscrawler/conv_impl/spss.py
index 2d102707..619ed9ab 100644
--- a/src/caoscrawler/conv_impl/spss.py
+++ b/src/caoscrawler/conv_impl/spss.py
@@ -31,10 +31,13 @@ from ..structure_elements import (File, StructureElement)
 from typing import Optional
 
 
-TYPES = {
+READSTAT_TYPES = {
     "double": "DOUBLE",
     "string": "TEXT",
 }
+ORIGINAL_TYPES = {
+    "EDATE8": "DATETIME",
+}
 
 
 class SPSSConverter(converters.TableConverter):
@@ -144,10 +147,13 @@ directory: # corresponds to the directory given to the crawler
     properties = OrderedDict()
 
     for name in meta.column_names:
+        datatype = ORIGINAL_TYPES.get(meta.original_variable_types[name],
+                                      READSTAT_TYPES[meta.readstat_variable_types[name]])
         prop = {
-            "datatype": TYPES[meta.readstat_variable_types[name]],
+            "datatype": datatype,
         }
         desc = meta.column_names_to_labels.get(name)
+
         if desc and desc != name:
             prop["description"] = desc
         # Handle categorial variables
-- 
GitLab