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

Empty-ied metadata fields should be removed entirely after meditor #2080

Open
bendichter opened this issue Nov 20, 2024 · 6 comments
Open

Empty-ied metadata fields should be removed entirely after meditor #2080

bendichter opened this issue Nov 20, 2024 · 6 comments
Assignees
Labels
bug Something isn't working UX Affects usability of the system

Comments

@bendichter
Copy link
Member

https://dandiarchive.org/dandiset/001170/draft is failing to validate but I am not sure why: contributor.3: {'url': '', 'name': 'Pirhayatifard, Delaram', 'email': '[email protected]', 'schemaKey': 'Person', 'includeInCitation': True} is not valid under any of the given schemas

@satra
Copy link
Member

satra commented Nov 20, 2024

url is empty

@satra
Copy link
Member

satra commented Nov 20, 2024

@mvandenburgh - any ideas how to fix this? i thought we had run into this in a previous issue and addressed it. one could clear everything out and fill it in again without touching the url field, but i recall we had done something about this.

@yarikoptic
Copy link
Member

I have replicated

  • in meditor, add space as URL, save record
  • go edit again, remove space and save
progression of records
❯ curl --silent -X 'GET' 'https://api-staging.dandiarchive.org/api/dandisets/214362/versions/draft/' -H 'accept: application/json' | jq '.contributor'
[
  {
    "name": "Halchenko, Yaroslav",
    "email": "[email protected]",
    "roleName": [
      "dcite:ContactPerson"
    ],
    "schemaKey": "Person",
    "affiliation": [],
    "includeInCitation": true
  }
]
❯ curl --silent -X 'GET' 'https://api-staging.dandiarchive.org/api/dandisets/214362/versions/draft/' -H 'accept: application/json' | jq '.contributor'
[
  {
    "url": " ",
    "name": "Halchenko, Yaroslav",
    "email": "[email protected]",
    "roleName": [
      "dcite:ContactPerson"
    ],
    "schemaKey": "Person",
    "affiliation": [],
    "includeInCitation": true
  }
]
❯ curl --silent -X 'GET' 'https://api-staging.dandiarchive.org/api/dandisets/214362/versions/draft/' -H 'accept: application/json' | jq '.contributor'
[
  {
    "url": "",
    "name": "Halchenko, Yaroslav",
    "email": "[email protected]",
    "roleName": [
      "dcite:ContactPerson"
    ],
    "schemaKey": "Person",
    "affiliation": [],
    "includeInCitation": true
  }
]

so I think meditor needs to clean up (remove) empty fields. To resolve this one in particular, I will go and fixup metadata directly in DB for now.

@yarikoptic yarikoptic changed the title invalid metadata Empty-ied metadata fields should be removed entirely after meditor Nov 20, 2024
@yarikoptic yarikoptic added bug Something isn't working UX Affects usability of the system labels Nov 20, 2024
@yarikoptic
Copy link
Member

I have tried to fix directly in DB via admin interface, but only caused 500. in logs:

heroku[router]: at=info method=POST path="/admin/api/version/1809/change/?_changelist_filters=q%3D1170" host=api.dandiarchive.org request_id=6f5d04a2-SENSORED fwd="SENSORED" dyno=web.2 connect=0ms service=676ms status=500 bytes=512 protocol=https

attn @dandi/archive-admin happen you see this -- it was me ;-/ I guess someone should fix via GET/fix/PUT

@bendichter
Copy link
Member Author

I was able to resolve this as @satra suggested, but removing this contributor and adding them again, though I would really prefer a solution where empty strings are converted to null

@kabilar
Copy link
Member

kabilar commented Nov 26, 2024

Thanks all. Will add this to the backlog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working UX Affects usability of the system
Projects
None yet
Development

No branches or pull requests

5 participants