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

[Feature]: CSV import extension #698

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

eacasu
Copy link
Contributor

@eacasu eacasu commented Mar 29, 2024

CSV import extensions:

  • event_type can now be specified as column in csv file. If column is not present, default collectives is used.
  • multiple leaders can now be specified. All columns starting with user_id will be considered for adding leaders. Leaders should be specified as "license_id" or "string(license_id)" or "license_id(string)".
  • multiple tags can now be specified. All columns starting with tag will be considered for adding tags.
  • delimiter is now determined with method csv.Sniffer().sniff

Potential retrocompatibility issues:

  • dictionary keys are now read from first row, thus they need to be specified correctly. Previously they were dictated by app.config["CSV_COLUMNS"] and they needed to have a specific order.
  • All files that did not contain correct key names in first row will not work after this merge request.

@eacasu eacasu requested a review from jnguiot March 29, 2024 11:32
@eacasu eacasu requested a review from 2Kable November 19, 2024 17:58
@2Kable 2Kable force-pushed the feature/CSV-import-extension branch from d9ef028 to 3f3194f Compare November 19, 2024 22:38

# remove all blank spaces in keys
row = {key.replace(" ", ""): value for key, value in row.items()}
event.event_type_id = EventType.get_type_from_csv_code(parse(row, "event_type"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This throws on old csv which do not specifies an event_type column

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

Successfully merging this pull request may close these issues.

2 participants