How can I manually set the `replication_key_value`...
# singer-tap-development
a
How can I manually set the
replication_key_value
? I am tapping an API where I must sort descending, so I want
replication_key_value
to be a timestamp of when I start a tap run. I set
self.replication_key_value
in the stream, but the state that is emitted is not affected by this
This works. Is this best practice?
Copy code
state = self.get_context_state(None)
state["replication_key_value"] = .......
e
the SDK always expects new replication values to be greater than the one before, so that may be why the state emitted doesn't reflect the timestamp. You may be better off using the state helper
increment_state
, which is part of the experimental
_state
module (cc @aaronsteers)
a
Thanks Edgar. That makes sense that it wouldn't function as expected with a descending sort order