Hello, How to update the state of stream manually ...
# troubleshooting
c
Hello, How to update the state of stream manually ?
h
I have tended to do this by going into the state database and update manually. As far as I know there isn’t any other way. If you use meltano out of the box, you will find a SQLite database in the .meltano folder, the tables are fairly self-describing.
c
I mean from tap
h
Right, so you want to tell the tap not to pull data from before X date? Some taps allow that in their config, but it it is really up to each tap. Setting state in Meltano is the only sure way to do it — providing the tap supports state, of course.
c
I want to backfill the data with 1 hour interval and also wanted to update the state
h
OK so you are writing your own tap? That is useful context, thanks. I have only done this for rest apis, inside the
prepare_request_payload
method like this: https://github.com/radbrt/tap-prefect/blob/main/tap_prefect/streams.py#L76
OK looking at it again now I suspect I’m still answering the wrong question 😅
c
No problem
h
I don’t think I have actually set this myself, but I have pondered a similar situation and what I wanted to do then was to just backdate the timestamp when preparing the request - in other words, I would let the SDK set the state, but I would change the timestamp when I used it.