Open karina-klinkeviciute opened 2 months ago
─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/karina/work/vssa/spinta/.venv/lib/python3.10/site-packages/spinta/cli/manifest.py:62 in │
│ copy │
│ │
│ 59 ): │
│ 60 │ """Copy models from CSV manifest files into another CSV manifest file""" │
│ 61 │ context: Context = ctx.obj │
│ ❱ 62 │ copy_manifest( │
│ 63 │ │ context, │
│ 64 │ │ source=source, │
│ 65 │ │ access=access, │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ access = 'private' │ │
│ │ columns = None │ │
│ │ context = <spinta.components.Context(cli:0) at 0x73860ed8e890> │ │
│ │ ctx = <click.core.Context object at 0x73860ed8f550> │ │
│ │ format_names = False │ │
│ │ manifests = [ │ │
│ │ │ │ │
│ │ '/home/karina/work/vssa/spinta/xsds/taar_result_naujas/dsa_1293_TAAR_is… │ │
│ │ ] │ │
│ │ order_by = None │ │
│ │ output = 'taar1293.csv' │ │
│ │ rename_duplicates = False │ │
│ │ source = True │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /home/karina/work/vssa/spinta/.venv/lib/python3.10/site-packages/spinta/cli/manifest.py:133 in │
│ copy_manifest │
│ │
│ 130 │ │ elif internal: │
│ 131 │ │ │ write_internal_sql_manifest(context, output, rows) │
│ 132 │ │ else: │
│ ❱ 133 │ │ │ write_tabular_manifest(context, output, rows) │
│ 134 │ else: │
│ 135 │ │ echo(render_tabular_manifest_rows(rows, cols)) │
│ 136 │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ access = <Access.private: 0> │ │
│ │ cols = None │ │
│ │ columns = None │ │
│ │ context = <spinta.components.Context(cli:0) at 0x73860ed8e890> │ │
│ │ format_names = False │ │
│ │ internal = False │ │
│ │ manifests = [ │ │
│ │ │ │ │
│ │ '/home/karina/work/vssa/spinta/xsds/taar_result_naujas/dsa_1293_TAAR_is… │ │
│ │ ] │ │
│ │ order_by = None │ │
│ │ output = 'taar1293.csv' │ │
│ │ output_type = None │ │
│ │ rename_duplicates = False │ │
│ │ rows = <generator object _read_and_return_rows at 0x73860c93d770> │ │
│ │ source = True │ │
│ │ verbose = True │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /home/karina/work/vssa/spinta/.venv/lib/python3.10/site-packages/spinta/manifests/tabular/helper │
│ s.py:2596 in write_tabular_manifest │
│ │
│ 2593 │ │
│ 2594 │ rows = ({c: row[c] for c in cols} for row in rows) │
│ 2595 │ if path.endswith('.csv'): │
│ ❱ 2596 │ │ write_csv(pathlib.Path(path), rows, cols) │
│ 2597 │ elif path.endswith('.xlsx'): │
│ 2598 │ │ write_xlsx(pathlib.Path(path), rows, cols) │
│ 2599 │ else: │
│ │
│ ╭───────────────────────────────────────── locals ─────────────────────────────────────────╮ │
│ │ cols = [ │ │
│ │ │ 'id', │ │
│ │ │ 'dataset', │ │
│ │ │ 'resource', │ │
│ │ │ 'base', │ │
│ │ │ 'model', │ │
│ │ │ 'property', │ │
│ │ │ 'type', │ │
│ │ │ 'ref', │ │
│ │ │ 'source', │ │
│ │ │ 'prepare', │ │
│ │ │ ... +5 │ │
│ │ ] │ │
│ │ context = <spinta.components.Context(cli:0) at 0x73860ed8e890> │ │
│ │ path = 'taar1293.csv' │ │
│ │ rows = <generator object write_tabular_manifest.
When trying to convert a manifest from Excel to csv or mmd format, I get the following error:
NestedDataTypeMissmatch: While nesting, 'ref' type cannot be cast to 'array' type.
This error happens when there is a ref property nested inside an array property.
full_name = 'extract.data[]' │ │ │ │ given_row = { │ │ │ │ │ 'id': None, │ │ │ │ │ 'dataset': None, │ │ │ │ │ 'resource': None, │ │ │ │ │ 'base': None, │ │ │ │ │ 'model': None, │ │ │ │ │ 'property': 'extract.data[].tempdocument', │ │ │ │ │ 'type': 'ref', │ │ │ │ │ 'ref': 'Tempdocument', │ │ │ │ │ 'source': 'TEMPDOCUMENT', │ │ │ │ │ 'prepare': None, │ │ │ │ │ ... +5 │ │ │ │ }