turicas/rows

`--input-locale` not working on bleeding-edge

Aberta

#228 aberto em 23 de jun. de 2017

 (0 comentário) (0 reação) (0 responsável)Python (136 forks)github user discovery
bugclihelp wantedrows.fields

Métricas do repositório

Stars
 (886 estrelas)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

The following command works on efa5def085196d7df35027c8191809608d937949 (current develop) but not on bleeding-edge (which is going to be the next develop after more tests/fixes):

URL="http://cidades.ibge.gov.br/comparamun/compara.php?idtema=1&codv=v01&coduf=33"
QUERY="SELECT * FROM table1 ORDER BY pessoas ASC LIMIT 10"
rows query --input-locale=pt_BR.UTF-8 "$QUERY" "$URL" 

The error is the following:

Traceback (most recent call last):
  File "/home/turicas/.virtualenvs/rows/bin/rows", line 11, in <module>
    load_entry_point('rows', 'console_scripts', 'rows')()
  File "/home/turicas/.virtualenvs/rows/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/turicas/.virtualenvs/rows/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/turicas/.virtualenvs/rows/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/turicas/.virtualenvs/rows/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/turicas/.virtualenvs/rows/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/turicas/projects/rows/rows/cli.py", line 336, in query
    table_name='table1')
  File "/home/turicas/projects/rows/rows/plugins/sqlite.py", line 168, in export_to_sqlite
    for batch in ipartition(prepared_table, batch_size):
  File "/home/turicas/projects/rows/rows/plugins/utils.py", line 74, in ipartition
    data.append(next(iterator))
  File "/home/turicas/projects/rows/rows/plugins/utils.py", line 245, in prepare_to_export
    for row in table:
  File "/home/turicas/projects/rows/rows/table.py", line 58, in __iter__
    zip(row, fields)])
  File "/home/turicas/projects/rows/rows/table.py", line 57, in <listcomp>
    for value, (field_name, field_type) in
  File "/home/turicas/projects/rows/rows/fields.py", line 182, in deserialize
    return int(value) if SHOULD_NOT_USE_LOCALE \
ValueError: invalid literal for int() with base 10: '169.511'

Guia do colaborador