Skip to content

Commit

Permalink
fix: Check if RK is sortable before comparing (#737)
Browse files Browse the repository at this point in the history
* fix: Check if RK is sortable before comparing

* Update changelog
  • Loading branch information
edgarrmondragon committed Jun 30, 2022
1 parent 2d26076 commit 5398730
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### New

- Tap and Target SDK: Adds the ability to override the [logging level](https://sdk.meltano.com/en/latest/implementation/logging.html) via `LOGLEVEL` environment variables. ([!300](https://gitlab.com/meltano/sdk/-/merge_requests/300)) - Thanks, _**[Eric Boucher](https://gitlab.com/ericboucher)**_!
- Tap SDK: Compare replication key values when incrementing state, only if the `not check_sorted` flag is set to True ([#736](https://github.com/meltano/sdk/issues/736), [#737](https://github.com/meltano/sdk/pull/737)).

### Changes

Expand Down
2 changes: 1 addition & 1 deletion singer_sdk/helpers/_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def increment_state(
progress_dict = stream_or_partition_state[PROGRESS_MARKERS]
old_rk_value = to_json_compatible(progress_dict.get("replication_key_value"))
new_rk_value = to_json_compatible(latest_record[replication_key])
if old_rk_value is None or new_rk_value >= old_rk_value or not check_sorted:
if old_rk_value is None or not check_sorted or new_rk_value >= old_rk_value:
progress_dict["replication_key"] = replication_key
progress_dict["replication_key_value"] = new_rk_value
return
Expand Down

0 comments on commit 5398730

Please sign in to comment.