Fixes bug in KafkaSource that crashes if some records exist upon import with the :on_duplicate_key_update option
Type of change
Please delete options that are not relevant.
[x] Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
[ ] In rails console:
# Same number of messages are published to kafka, with the correct content
# 1. Import still works
YourModel.import(<new_records>)
## Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream modules
Description
Fixes bug in
KafkaSource
that crashes if some records exist upon import with the:on_duplicate_key_update
optionType of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
2. Import with :on_duplicate_key_update option
YourModel.import(, on_duplicate_key_update: %i(columns_to_update))
3. Import with :on_duplicate_key_update option and a mix of new and existing records
YourModel.import(, on_duplicate_key_update: %i(columns_to_update))