flipp-oss / deimos

Framework to work with Kafka, Avro and ActiveRecord
Other
59 stars 22 forks source link

GUILD-131: Do not crash if some records exist upon import with 'on_duplicate_key_update' #60

Closed DeeChau closed 4 years ago

DeeChau commented 4 years ago

Description

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.

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))



## 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