etalab / DVF-app

Exploration des données DVF

Home Page:https://app.dvf.etalab.gouv.fr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An error occurred "section_prefix"

alexandershabunevich opened this issue · comments

Good afternoon.

When I import data for 2019 ( add to previously imported data from 2014 to 2018, script import here line 26 https://github.com/etalab/DVF-app/blob/master/db/build_db.sh ) in postgresql on MacBook Pro (installed OS latest version) error occurs-missing data for column "section_prefixe". Please specify how you can fix it and correctly import data. The error log is given below:

ERROR: missing data for column "section_prefixe"
CONTEXT: COPY dvf, line 2: "2019-1,2019-01-11,000001,Vente,84000,552,,AV DE LYON,0260,01960,01289,Péronnas,01,,,01289000AD0226,..."

id_mutation,date_mutation,numero_disposition,nature_mutation,valeur_fonciere,adresse_numero,adresse_suffixe,adresse_nom_voie,adresse_code_voie,code_postal,code_commune,nom_commune,code_departement,ancien_code_commune,ancien_nom_commune,id_parcelle,ancien_id_parcelle,numero_volume,lot1_numero,lot1_surface_carrez,lot2_numero,lot2_surface_carrez,lot3_numero,lot3_surface_carrez,lot4_numero,lot4_surface_carrez,lot5_numero,lot5_surface_carrez,nombre_lots,code_type_local,type_local,surface_reelle_bati,nombre_pieces_principales,code_nature_culture,nature_culture,code_nature_culture_speciale,nature_culture_speciale,surface_terrain,longitude,latitude
2019-1,2019-01-11,000001,Vente,84000,552,,AV DE LYON,0260,01960,01289,Péronnas,01,,,01289000AD0226,,,44,,,,,,,,,,1,3,Dépendance,,0,,,,,,5.208543,46.187709
2019-1,2019-01-11,000001,Vente,84000,552,,AV DE LYON,0260,01960,01289,Péronnas,01,,,01289000AD0226,,,1,,36,67.08,,,,,,,2,2,Appartement,67,3,,,,,,5.208543,46.187709
2019-2,2019-02-08,000001,Vente,210000,5189,,LE METRILLOT,B041,01250,01254,Montagnat,01,,,01254000BB0023,,,,,,,,,,,,,0,1,Maison,118,4,AG,terrains d'agrément,PARC,Parc,913,5.270659,46.164406
2019-2,2019-02-08,000001,Vente,210000,5189,,LE METRILLOT,B041,01250,01254,Montagnat,01,,,01254000BB0023,,,,,,,,,,,,,0,1,Maison,118,4,S,sols,,,1000,5.270659,46.164406
2019-3,2019-04-04,000001,Vente,36000,40,,PL DE LA FONTAINE,0090,01560,01367,Saint-Julien-sur-Reyssouze,01,,,013670000A0138,,,,,,,,,,,,,0,1,Maison,60,3,S,sols,,,96,5.110259,46.400996
2019-4,2019-05-28,000003,Vente,600000,17,,AV ARSENE D ARSONVAL,0015,01000,01053,Bourg-en-Bresse,01,,,01053000BO0552,,,,,,,,,,,,,0,,,,,S,sols,,,1,5.218298,46.218864
2019-4,2019-05-28,000003,Vente,600000,17,B,AV ARSENE D ARSONVAL,0015,01000,01053,Bourg-en-Bresse,01,,,01053000BO0553,,,,,,,,,,,,,0,4,Local industriel. commercial ou assimilé,900,0,S,sols,,,8912,5.218055,46.219114
2019-4,2019-05-28,000003,Vente,600000,17,B,AV ARSENE D ARSONVAL,0015,01000,01053,Bourg-en-Bresse,01,,,01053000BO0553,,,,,,,,,,,,,0,4,Local industriel. commercial ou assimilé,800,0,S,sols,,,8912,5.218055,46.219114
2019-5,2019-01-08,000001,Vente,84920,25,,RUE DE LA COMMUNE 1871,0246,01500,01004,Ambérieu-en-Bugey,01,,,01004000AP0963,,,2,39.42,,,,,,,,,1,2,Appartement,39,2,,,,,,5.350335,45.969487

I guess you're not working with the good tables because tables from etalab (not from DGFIP) don't contain the field section_prefixe. Run build_db.sh from A to Z (your tables 2014 - 2018 are obsolete, you must empty your database and use the new version of those tables).