Closed abulte closed 1 year ago
Tested with #48, works perfectly 👏
[:~/Developer/Etalab/udata-hydra] add-csv-detective-types(+8/-6)+ ± poetry run udata-hydra analyse-csv --url http://data.caf.fr/dataset/f6411f07-10bf-4f13-b4fb-8d30ba9328b5/resource/94a182c4-19c8-4d3a-987c-187a49756365/download/txcouvglo2014.csv
2023-02-07 10:40:30 dev.local asyncio[16702] DEBUG Using selector: KqueueSelector
2023-02-07 10:40:34 dev.local udata-hydra[16702] DEBUG Converting from CSV to db for 3e1b3d2ce6e2f7f16c3f7d2183a08eef
[:~/Developer/Etalab/udata-hydra] add-csv-detective-types(+8/-6)+ ± docker compose exec -it -u postgres database-csv psql
psql (11.2 (Debian 11.2-1.pgdg90+1))
Type "help" for help.
postgres=# \d 3e1b3d2ce6e2f7f16c3f7d2183a08eef
Table "public.3e1b3d2ce6e2f7f16c3f7d2183a08eef
"
Column | Type | Collation | Nullable |
Default
---------------------+-------------------+-----------+----------+-----------------------
-------------------------------------------
__id | integer | | not null | nextval('"3e1b3d2ce6e2
f7f16c3f7d2183a08eef___id_seq"'::regclass)
NUMCOM | character varying | | |
NOMCOM | character varying | | |
NUMDEP | character varying | | |
NOMDEP | character varying | | |
NUMEPCI | character varying | | |
NOMEPCI | character varying | | |
TXCOUVGLO_COM_2014 | double precision | | |
TXCOUVGLO_DEP_2014 | double precision | | |
TXCOUVGLO_EPCI_2014 | double precision | | |
Indexes:
"3e1b3d2ce6e2f7f16c3f7d2183a08eef_pkey" PRIMARY KEY, btree (__id)
postgres=# select * FROM "3e1b3d2ce6e2f7f16c3f7d2183a08eef" limit 1;
__id | NUMCOM | NOMCOM | NUMDEP | NOMDEP | NUMEPCI | NOMEPCI
| TXCOUVGLO_COM_2014 | TXCOUVGLO_DEP_2014 | TXCOUVGLO_EPCI_2014
------+--------+-------------------------+--------+--------+-----------+----------------
------+--------------------+--------------------+---------------------
1 | 01001 | L'ABERGEMENT-CLEMENCIAT | 01 | AIN | 200035210 | CC CHALARONNE C
ENTRE | 41.7 | 65.2 | 72.9
(1 row)
NUMCOM
andNUMDEP
should not be detected as int (Corsica forever)http://data.caf.fr/dataset/f6411f07-10bf-4f13-b4fb-8d30ba9328b5/resource/94a182c4-19c8-4d3a-987c-187a49756365/download/txcouvglo2014.csv