From ee139a34dd66c06e860baef2d85950cd4562056b Mon Sep 17 00:00:00 2001
From: thomaswoehlke <thomas.woehlke@gmail.com>
Date: Wed, 17 Feb 2021 20:39:39 +0100
Subject: [PATCH] ### 0.0.17 Release * ------------------------------------- *
 Issue #82 change to ORM ClassHierarchy * Fixed #108 change to ORM
 ClassHierarchy in: EcdcImport.get_countries_of_continent * Fixed #39
 SQLalchemy instead of SQL: AllModelClasses.remove_all() * Fixed #40
 SQLalchemy instead of SQL: EcdcImport.get_date_rep() * Fixed #41 SQLalchemy
 instead of SQL: EcdcImport.get_countries_of_continent() * Fixed #107
 SQLalchemy instead of SQL in: EcdcImport.get_countries_of_continent * Fixed
 #109 SQLalchemy instead of SQL in: EcdcImport.get_date_rep * Fixed #110
 SQLalchemy instead of SQL in: EcdcImport.get_continent *
 ------------------------------------- * Fixed #123 split
 RkiBundeslaenderService into two Services, one for bundeslaender and one for
 landkreise * Fixed #128 add fields from csv to RkiLandkreiseImport * Fixed
 #139 refactor RkiBundeslaenderServiceDownload to new method scheme introduced
 07.02.2021 * Fixed #140 move WhoImport to RKI in: rk_service_import.py *
 Fixed #125 implement RkiLandkreise * Fixed #126 implement
 RkiBundeslaenderImport * Issue #129 change to ORM ClassHierarchy in:
 RkiLandkreiseImport.get_new_dates_as_array * Issue #131 change to ORM
 ClassHierarchy in: RkiGermanyDataImportTable.get_new_dates_as_array * Issue
 #146 add Tasks and URLs for starting Tasks to rki_views * Issue #127
 implement RkiBundeslaenderImport.get_dates_reported * Issue #132 refactor
 RkiBundeslaenderService to new method scheme introduced 07.02.2021 * Issue
 #133 implement RkiBundeslaenderService.task_database_drop_create * Issue #134
 implement RkiBundeslaenderService.run_update_dimension_tables_only * Issue
 #135 implement RkiBundeslaenderService.run_update_fact_table_incremental_only
 * Issue #136 implement
 RkiBundeslaenderService.run_update_fact_table_initial_only * Issue #137
 implement RkiBundeslaenderService.run_update_star_schema_incremental * Issue
 #138 implement RkiBundeslaenderService.run_update_star_schema_initial * Issue
 #141 implement RkiBundeslaenderServiceUpdate.update_dimension_tables_only *
 Issue #142 implement
 RkiBundeslaenderServiceUpdate.update_fact_table_incremental_only * Issue #143
 implement RkiBundeslaenderServiceUpdate.update_fact_table_initial_only *
 Issue #144 implement
 RkiBundeslaenderServiceUpdate.update_star_schema_incremental * Issue #145
 implement RkiBundeslaenderServiceUpdate.update_star_schema_initial * Issue
 #147 refactor RkiBundeslaenderServiceUpdate.__update_who_date_reported *
 Issue #148 refactor RkiBundeslaenderServiceUpdate.__update_who_region * Issue
 #149 refactor RkiBundeslaenderServiceUpdate.__update_who_country * Issue #150
 refactor RkiBundeslaenderServiceUpdate.__update_who_global_data * Issue #151
 refactor RkiBundeslaenderServiceUpdate.__update_who_global_data_short * Issue
 #152 refactor RkiBundeslaenderServiceUpdate.__update_who_global_data_initial
 * Issue #153 refactor RkiBundeslaenderServiceUpdate.update_db * Issue #154
 refactor RkiBundeslaenderServiceUpdate.update_db_short * Issue #155 refactor
 RkiBundeslaenderServiceUpdate.update_db_initial

### 0.0.18 Release
* Issue #42 SQLalchemy instead of SQL: WhoImport.get_new_dates_as_array()
* Issue #83 SQLalchemy instead of SQL in WhoImport.get_new_dates_as_array
---
 .../rki_bundeslaender/rki_service_config.py   |  5 +-
 .../rki_landkreise/rki_service_config.py      |  5 +-
 .../rki_landkreise/rki_service_import.py      | 55 ++++++++++++++++---
 3 files changed, 51 insertions(+), 14 deletions(-)

diff --git a/src/covid19/blueprints/rki_bundeslaender/rki_service_config.py b/src/covid19/blueprints/rki_bundeslaender/rki_service_config.py
index 5437c8e9..07d615c6 100644
--- a/src/covid19/blueprints/rki_bundeslaender/rki_service_config.py
+++ b/src/covid19/blueprints/rki_bundeslaender/rki_service_config.py
@@ -5,8 +5,7 @@ import os
 class RkiBundeslaenderServiceConfig:
     def __init__(self):
         self.limit_nr = 20
-        datum_heute = date.today().isoformat()
-        self.cvsfile_name = "RKI_COVID19__" + datum_heute + "__bundeslaender.csv"
+        self.data_path = ".."+os.sep+".."+os.sep+"data"
         self.url_src = "https://opendata.arcgis.com/datasets/ef4b445a53c1406892257fe63129a8ea_0.csv"
-        self.data_path = ".." + os.sep + ".." + os.sep + "data" + os.sep
+        self.cvsfile_name = "RKI_COVID19__" + date.today().isoformat() + "__bundeslaender.csv"
         self.src_cvsfile_path = self.data_path + self.cvsfile_name
diff --git a/src/covid19/blueprints/rki_landkreise/rki_service_config.py b/src/covid19/blueprints/rki_landkreise/rki_service_config.py
index 8c2b5191..76554d16 100644
--- a/src/covid19/blueprints/rki_landkreise/rki_service_config.py
+++ b/src/covid19/blueprints/rki_landkreise/rki_service_config.py
@@ -5,8 +5,7 @@ import os
 class RkiLandkreiseServiceConfig:
     def __init__(self):
         self.limit_nr = 20
-        datum_heute = date.today().isoformat()
-        self.cvsfile_name = "RKI_COVID19__" + datum_heute + "__landkreise.csv"
+        self.data_path = ".."+os.sep+".."+os.sep+"data"
         self.url_src = "https://opendata.arcgis.com/datasets/917fc37a709542548cc3be077a786c17_0.csv"
-        self.data_path = ".." + os.sep + ".." + os.sep + "data" + os.sep
+        self.cvsfile_name = "RKI_COVID19__" + date.today().isoformat() + "__landkreise.csv"
         self.src_cvsfile_path = self.data_path + self.cvsfile_name
diff --git a/src/covid19/blueprints/rki_landkreise/rki_service_import.py b/src/covid19/blueprints/rki_landkreise/rki_service_import.py
index 1c62ed04..639dd176 100644
--- a/src/covid19/blueprints/rki_landkreise/rki_service_import.py
+++ b/src/covid19/blueprints/rki_landkreise/rki_service_import.py
@@ -37,14 +37,53 @@ class RkiLandkreiseServiceImport:
                 for row in file_reader:
                     # TODO: #140 move WhoImport to RKI in: rk_service_import.py
                     o = RkiLandkreiseImport(
-                        date_reported=row[keyDate_reported],
-                        country_code=row['Country_code'],
-                        country=row['Country'],
-                        who_region=row['WHO_region'],
-                        new_cases=row['New_cases'],
-                        cumulative_cases=row['Cumulative_cases'],
-                        new_deaths=row['New_deaths'],
-                        cumulative_deaths=row['Cumulative_deaths']
+                        OBJECTID=row['OBJECTID'],
+                        ADE=row['ADE'],
+                        GF=row['GF'],
+                        BSG=row['BSG'],
+                        RS=row['RS'],
+                        AGS=row['AGS'],
+                        SDV_RS=row['SDV_RS'],
+                        GEN=row['GEN'],
+                        BEZ=row['BEZ'],
+                        IBZ=row['IBZ'],
+                        BEM=row['BEM'],
+                        NBD=row['NBD'],
+                        SN_L=row['SN_L'],
+                        SN_R=row['SN_R'],
+                        SN_K=row['SN_K'],
+                        SN_V1=row['SN_V1'],
+                        SN_V2=row['SN_V2'],
+                        SN_G=row['SN_G'],
+                        FK_S3=row['FK_S3'],
+                        NUTS=row['NUTS'],
+                        RS_0=row['RS_0'],
+                        AGS_0=row['AGS_0'],
+                        WSK=row['WSK'],
+                        EWZ=row['EWZ'],
+                        KFL=row['KFL'],
+                        DEBKG_ID=row['DEBKG_ID'],
+                        death_rate=row['death_rate'],
+                        cases=row['cases'],
+                        deaths=row['deaths'],
+                        cases_per_100k=row['cases_per_100k'],
+                        cases_per_population=row['cases_per_population'],
+                        BL=row['BL'],
+                        BL_ID=row['BL_ID'],
+                        county=row['county'],
+                        last_update=row['last_update'],
+                        cases7_per_100k=row['cases7_per_100k'],
+                        recovered=row['recovered'],
+                        EWZ_BL=row['EWZ_BL'],
+                        cases7_bl_per_100k=row['cases7_bl_per_100k'],
+                        cases7_bl=row['cases7_bl'],
+                        death7_bl=row['death7_bl'],
+                        cases7_lk=row['cases7_lk'],
+                        death7_lk=row['death7_lk'],
+                        cases7_per_100k_txt=row['cases7_per_100k_txt'],
+                        AdmUnitId=row['AdmUnitId'],
+                        SHAPE_Length=row['SHAPE_Length'],
+                        SHAPE_Area=row['SHAPE_Area'],
                     )
                     db.session.add(o)
                     if (k % 2000) == 0:
-- 
GitLab