Conversation
|
Also I reworked the |
JackWilb
left a comment
There was a problem hiding this comment.
Looks good to me and works as intended. I'm not sure we should force users to use _key if it exists though. I think we should suggest it, if it exists, but I don't think it should throw a validation error if another key variable is specified
I see your point, but if we allow that then we'll be overwriting the |
Makes sense. Maybe a suitable solution would be to just rename the field the original |
waxlamp
left a comment
There was a problem hiding this comment.
This looks great. Withholding approval until we resolve the discussion about what to do in case of existing _key.
The best thing to do is add one more toggle in the UI, a checkbox that says something like "Overwrite _key field if it exists". If that checkbox is unchecked, and the uploaded file contains a _key field, then it should fail validation with something like "Existing _key field would be overwritten". On the serverside, this ought to be fairly simple to add--it requires one more What do you think, @AlmightyYakob? |
That sounds like a good idea. Specifically, I think the default should be the unchecked state, to be safe. |
Agreed. Do you want to add this feature in on the current PR, or in a followup? |
I can add it here, it's pretty relevant to this change so I think it's warranted. |
Backend support for multinet-app/multinet-client#15.
One thing to note, after adding this support, I think we should split up the
validate_csvfunction, as I'm no longer satisfied with the way it operates:multinet-server/multinet/uploaders/csv.py
Lines 48 to 91 in f3bf95a
The current way it works is messy, and does the testing for both node and edge tables, but really they're mutually exclusive test cases, and have no real reason to be in the same function. Splitting them up to do their respective checking would eliminate the need for confusing conditionals against the
keyargument. I would have done this here, but I thought it'd be too big of a change, and thought it'd be better to do that in a separate PR.Anyway, please lmk what you guys think.