Is it possible to access tap config from within a ...
# singer-tap-development
j
Is it possible to access tap config from within a paginator class? I'd like to create a 'developer mode' that stops after the first page.
I can do this by creating a second paginator that just always sets
has_more
to true and call this conditionally in
get_new_paginator
but it seems hacky
a
I just had a look at the constructors. These don't accept
config
but many of our other classes do. If you subclass the Paginator's constructor, you can then send either the full
config
dict or just a specific flag or param within the Stream's
get_new_paginator()
method. Another approach would be to subclass your
MyPaginator
class as something like
MyDryRunPaginator
or
MyNoopPaginator
and return an instance of that class instead of the "real one" in
get_new_paginator()
. Since
get_new_paginator()
would have access to
Stream.config
, you could trigger this behavior based upon specific config flag.
j
Yeah the second approach was what I was trying to describe above, I might end up that path