Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on push with geometry type #652

Closed
sirex opened this issue Jun 14, 2024 · 0 comments · Fixed by #659
Closed

Error on push with geometry type #652

sirex opened this issue Jun 14, 2024 · 0 comments · Fixed by #659
Assignees
Labels
bug Something isn't working U2 Užsakymo indeksas

Comments

@sirex
Copy link
Collaborator

sirex commented Jun 14, 2024

When trying to spinta push data with geometry type, following error is raised:

$ spinta --version
0.1.60

$ spinta push sdsa.xlsx -o put-test.data.gov.lt -d datasets/gov/rc/ar/graapskritis 
Traceback (most recent call last): 
  File "cli/push.pyw, line 460, in _push rows
    next(rows) 
  File "spinta/cli/push.py", line 1353, in _save_push_state
    for row in rows: 
  File "spinta/cli/push.py", line 919, in _push_to_remote_spinta
    for row in rows: 
  File "spinta/cli/push.py", line 881, in _prepare_rows_for_push
    for row in rows: 
  File "spinta/cli/push.py", line 1306, in _check_push_state
    for model_type, group in itertools.groupby(rows, key= get_model_type): 
  File "spinta/cli/push.py", line 408, in _read_rows
    yield from _get_model_rows( 
  File "spinta/cli/push.py", line 526, in _get_model_rows
    for row in rows: 
  File "spinta/cli/push.py", line 564, in _iter_model_rows
    for row in rows: 
  File "spinta/cli/push.py", line 739, in _read_rows_by_pages
    row. checksum = _get_data_checksum(row.data) 
  File "spinta/cli/push.py", line 1270, in _get_data_checksum
    data = fix_data_for_json(take(data)) 
  File "spinta/utils/json.py", return (k: fix_data_for_json(v) for
    k, v in data.items()) line 9, in fix_data_for_json 
  File "spinta/utils/json.py", return (k: fix_data_for_json(v) for
    k, v in data.items()) line 9, in <dictcomp> 
  File "spinta/utils/json.py", line 24, in fix_data_for_json 
    raise TypeError(f"{type(data)} probably won't serialize to JSON.")
TypeError: <class 'shapely.geometry.polygon.Polygon'> probably won't serialize to JSON.
@sirex sirex added the bug Something isn't working label Jun 14, 2024
@JustinasKen JustinasKen linked a pull request Jun 18, 2024 that will close this issue
@ATEAanalyst ATEAanalyst added the U2 Užsakymo indeksas label Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working U2 Užsakymo indeksas
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants