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

Update and fix CSV import #1629

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

dsblank
Copy link
Member

@dsblank dsblank commented Dec 28, 2023

This might be too late for gramps52, but this does fix the bug (overwrites firstname) and adds tags to all import types (in CSV), both mentioned in:

https://gramps.discourse.group/t/how-can-people-be-deleted-according-to-a-list/4511/13?u=dsblank

It is ok to apply to master.

@dsblank
Copy link
Member Author

dsblank commented Dec 28, 2023

Looks like I broke a test. Fixing...

@emyoulation
Copy link
Contributor

May I ask why the CSV parser allows adding a Source, but not a Citation? (Or maybe it does and the Wiki overlooks documenting it?)

@emyoulation
Copy link
Contributor

Is it possible that the import was originally intended to parse a Full Name ("Surname, Given name")? If so, that would be a useful functionality to keep.

The date is passed through the Date string validator. Perhaps the Place was expected to be a Place Title? From before the Place hierarchy was implemented.

@dsblank
Copy link
Member Author

dsblank commented Dec 28, 2023

Is it possible that the import was originally intended to parse a Full Name ("Surname, Given name")?

No, I don't think I ever allowed that as it would be too complicated considering this is CSV.

May I ask why the CSV parser allows adding a Source, but not a Citation?

I can add that in the future if it isn't urgent for now.

The date is passed through the Date string validator. Perhaps the Place was expected to be a Place Title? From before the Place hierarchy was implemented.

Is there a bug related to this?

@emyoulation
Copy link
Contributor

No bug. It works fine. Just trying to discover the design approach. So I can determine whether it makes more sense to leverage it... or to embed functions if it is likely to evolve in an opposite direction.

@dsblank
Copy link
Member Author

dsblank commented Dec 29, 2023

May I ask why the CSV parser allows adding a Source, but not a Citation?

Looking at the code, I guess for simplicity (or was just based on my workflow). It does create a default citation, but doesn't allow you to use an existing one, or to provide values.

@dsblank
Copy link
Member Author

dsblank commented Dec 29, 2023

All tests passing now.

@emyoulation
Copy link
Contributor

emyoulation commented Dec 29, 2023

Looking at the code, I guess for simplicity (or was just based on my workflow). It does create a default citation, but doesn't allow you to use an existing one, or to provide values.

My common case when flowing data from a source via CSV is that they share the same citation. i.e., all the data was transcribed from pages 7-12 of that source.

So maybe there could be an option to create a single shared citation for the source as an alternative to serialized citations?

(A workaround is to use the Isotammi addon : MultiMergeGramplet immediately after import. Sort the Citation by modify date, select all the ones in the right time frame, and Merge selected using the Citations sidebar MultiMergeGramplet.)

@dsblank
Copy link
Member Author

dsblank commented Dec 29, 2023

So maybe there could be an option to create a single shared citation for the source as an alternative to serialized citations?

Good idea! I'll do this for an updated 5.2 once it is out.

@dsblank dsblank requested a review from Nick-Hall December 29, 2023 15:55
@emyoulation
Copy link
Contributor

please add 'tags' into the recognized headers. This is what is used for export.

It outputs a CSV string. e.g. "ToDo, Complete, Imported 2024/01/11 10:18:02, Another tag"

Import by relabeling the 'Tags' to "tag" creates Tag named for the various combination. Such as named "ToDo, Complete, Imported 2024/01/11 10:18:02, Another tag" and "ToDo, Another tag"

@Nick-Hall Nick-Hall added the bug label Feb 7, 2024
@Nick-Hall Nick-Hall force-pushed the dsb/update-and-fix-csv-import branch from 2bd0448 to 7ae774a Compare February 7, 2024 23:16
@Nick-Hall Nick-Hall merged commit 7ae774a into maintenance/gramps52 Feb 7, 2024
4 checks passed
@Nick-Hall Nick-Hall deleted the dsb/update-and-fix-csv-import branch February 7, 2024 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants