Hello, I have a tap where most of my stream endpoi...
# singer-target-development
i
Hello, I have a tap where most of my stream endpoints require pagination (between two dates) which I currently have working - however I also have a tap that only requires a boolean parameter True or False without the date parameters since it only returns a few hundred rows (pulls active users). How should I go about overriding the other parameter logic so I only pass in the True or False parameter and turn off pagination?
Copy code
class UsersListStream(JobDivaStream):

    def get_new_paginator(self):
        return None
    
    def get_url_params(
    self,
    context: dict | None,  # noqa: ARG002
    next_page_token: date | None,  # noqa: ANN401
    ) -> dict[str, Any]:
        return {
            "onlyInternalUsers": True,
        }
I added this to my stream class - what else do I need to do? Or am I doing this wrong lol
1
e
You may want to return an instance of
singer_sdk.pagination.SinglePagePaginator
i
In my stream class?
and then keep get_url_params the same
e
Yes, from
get_new_paginator
. Your
get_url_params
is good as is.
1
i
So should I just add
from singer_sdk import pagination
import in my streams.py and then in my get_new_paginator:
return pagination.SinglePagePaginator(self)
nvm figured it out
👍 1
Copy code
from singer_sdk.pagination import SinglePagePaginator

...

class UsersListStream(JobDivaStream):

    def get_new_paginator(self):
        return SinglePagePaginator()