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

towards v1.10.0 [BREAKING] #263

Merged
merged 24 commits into from
Dec 31, 2023
Merged

towards v1.10.0 [BREAKING] #263

merged 24 commits into from
Dec 31, 2023

Conversation

tilo
Copy link
Owner

@tilo tilo commented Dec 16, 2023

  1. Refactoring of Code and Tests

  2. Performance Improvements

  3. Previous versions of SmarterCSV applied some header transformations when user_provided_headers were provided.

This legacy behavior does not make much sense, because when user_provided_headers are given, we can assume they are correct, and should be used as-is.

For the unlikely scenario that incorrect user_provided_headers were given, the legacy code attempted to disambiguate them, by applying a suffix.

  1. Previously strings_as_keys transformations were applied to user_provided_headers

This legacy behavior does not make much sense, because when user_provided_headers are given, we can assume they are correct, and should be used as-is.

BREAKING CHANGES:

  • when user_provided_headers are provided:

    • if they are not unique, an exception will now be raised
    • they are taken "as is", no header transformations can be applied
    • when they are given as strings or as symbols, it is assumed that this is the desired format
    • the value of the strings_as_keys options will be ignored
  • option duplicate_header_suffix now defaults to '' instead of nil.

    • this allows automatic disambiguation when processing of CSV files with duplicate headers, by appending a number
    • explicitly set this option to nil to get the behavior from previous versions.

@tilo tilo merged commit 90f3dc1 into main Dec 31, 2023
27 checks passed
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.

1 participant