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

DSA error: Enum '' item 'None' with the same value is already defined (AR) #978

Open
Tracked by #966
ievabraskute opened this issue Nov 27, 2024 · 6 comments
Open
Tracked by #966

Comments

@ievabraskute
Copy link
Contributor

ievabraskute commented Nov 27, 2024

❗ see comments

Should enum values be defined in "source" instead?

Image

data = {'id': None, 'name': '', 'source': None, 'prepare': 'housingIdentifier', 'access': 'open', 'title': None, 'description': None}

Executing: copy -o /Users/ibraske/projects/spinta_data/AR_tikrinami/results/dsa_AR_text_with_coordinates.csv /Users/ibraske/projects/spinta_data/AR_tikrinami/dsa_AR_text_with_coordinates.xlsx

Exception has occurred: TabularManifestError       (note: full exception trace is shown but execution is paused at: copy)
/Users/ibraske/projects/spinta_data/AR_tikrinami/dsa_AR_text_with_coordinates.xlsx:Auto DSA  XSD:91: Enum '' item 'None' with the same value is already defined.
  File "/Users/ibraske/projects/spinta/spinta/manifests/tabular/helpers.py", line 239, in error
    raise TabularManifestError(f"{self.path}:{self.line}: {message}")
  File "/Users/ibraske/projects/spinta/spinta/manifests/tabular/helpers.py", line 1418, in read
    self.error(
  File "/Users/ibraske/projects/spinta/spinta/manifests/tabular/helpers.py", line 1425, in append
    self.read(row)
  File "/Users/ibraske/projects/spinta/spinta/manifests/tabular/helpers.py", line 1183, in leave
    self.state.stack[-1].append(self.data)
  File "/Users/ibraske/projects/spinta/spinta/manifests/tabular/helpers.py", line 1627, in release
    parent.leave()
  File "/Users/ibraske/projects/spinta/spinta/manifests/tabular/helpers.py", line 1665, in _read_tabular_manifest_rows
    yield from state.release(reader)
  File "/Users/ibraske/projects/spinta/spinta/manifests/tabular/helpers.py", line 1710, in read_tabular_manifest
    yield from _read_tabular_manifest_rows(
  File "/Users/ibraske/projects/spinta/spinta/manifests/helpers.py", line 133, in load_manifest_nodes
    for eid, schema in schemas:
  File "/Users/ibraske/projects/spinta/spinta/manifests/tabular/commands/load.py", line 59, in load
    load_manifest_nodes(context, into, schemas, source=manifest)
  File "/Users/ibraske/projects/spinta/spinta/manifests/yaml/commands/load.py", line 110, in load
    commands.load(
  File "/Users/ibraske/projects/spinta/spinta/cli/helpers/store.py", line 127, in load_manifest
    commands.load(
  File "/Users/ibraske/projects/spinta/spinta/cli/manifest.py", line 176, in _read_and_return_rows
    store = load_manifest(
  File "/Users/ibraske/projects/spinta/spinta/manifests/tabular/helpers.py", line 2670, in <genexpr>
    rows = ({c: row[c] for c in cols} for row in rows)
  File "/Users/ibraske/projects/spinta/spinta/manifests/tabular/helpers.py", line 2687, in write_csv
    writer.writerows(rows)
  File "/Users/ibraske/projects/spinta/spinta/manifests/tabular/helpers.py", line 2672, in write_tabular_manifest
    write_csv(pathlib.Path(path), rows, cols)
  File "/Users/ibraske/projects/spinta/spinta/cli/manifest.py", line 133, in copy_manifest
    write_tabular_manifest(context, output, rows)
  File "/Users/ibraske/projects/spinta/spinta/cli/manifest.py", line 62, in copy (Current frame)
    copy_manifest(
  File "/Users/ibraske/projects/spinta/_process_dsa.py", line 50, in main
    result = runner.invoke(app, args)
  File "/Users/ibraske/projects/spinta/_process_dsa.py", line 61, in <module>
    main()
spinta.manifests.tabular.helpers.TabularManifestError: /Users/ibraske/projects/spinta_data/AR_tikrinami/dsa_AR_text_with_coordinates.xlsx:Auto DSA  XSD:91: Enum '' item 'None' with the same value is already defined.
@karina-klinkeviciute
Copy link
Contributor

ar čia klaida DSA ar spintoje?

@ievabraskute ievabraskute changed the title DSA error: Enum '' item 'None' with the same value is already defined DSA error: Enum '' item 'None' with the same value is already defined (AR) Nov 28, 2024
@karina-klinkeviciute
Copy link
Contributor

karina-klinkeviciute commented Dec 5, 2024

They are correctly defined in the prepare column. The question is - should they also have a source in this case, or not. It is possible to not have a source if model doesn't have a resource. I'm not sure if this empty source is correct in this case, or not.

Manto komentaras:

Teoriškai reikėtu perkelti už resource, bet techniškai nėra būtina. RC tokiu būdu formuoja koncepcinį modelį, kuris nėra susietas so jokiu resource ir naudoja tokius modelius, kaip bazinius.

Konkrečiai LocatorDesignator/:part atveju, modelis naudojamas kaip jungtinio modelio dalis /:part. Kuris tiesiogiai nesiejamas su šaltiniu ir yra naudojamas ir siejamas su šaltiniu jungtiniame modelyje.

Taip, kaip dabar apibrėžtas LocatorDesignator/:part/type yra padaryta gerai.

So this is an error in spinta. Corect behaviour and rules should still be probably defined

@karina-klinkeviciute karina-klinkeviciute self-assigned this Dec 10, 2024
@karina-klinkeviciute
Copy link
Contributor

I can't reproduce this error

@sirex
Copy link
Collaborator

sirex commented Dec 11, 2024

I can't reproduce this error

Did you checked https://github.com/ivpk/metadata/pulls? Where this error comes from and did you tried to reproduce this on the same pull request?

@karina-klinkeviciute
Copy link
Contributor

no, I haven't tried to reproduce it with pulls. I will though. I suspect it might be on #1004

@karina-klinkeviciute
Copy link
Contributor

I tried with the pull request, on which @ievabraskute was registering the errors (branch #582) but even with that branch I can't reproduce the error.

@ievabraskute can you reproduce this again?

@karina-klinkeviciute karina-klinkeviciute removed their assignment Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants