Hey all! Using the <tap-recharge> extractor, I wan...
# troubleshooting
n
Hey all! Using the tap-recharge extractor, I want to only pull data in a certain range of dates, but there is no
end_date
parameter that I am aware of for that extractor. I know there is a GET request somewhere in the code which pulls from a URL. Does anyone know where the URL is specified and if I can manipulate that URL field to give the URL with the parameters i'm looking for? For Example: /subscriptions?limit=25&created_at_min=2022-09-12&created_at_max=2022-09-14. Any help is appreciated!
e
I don’t see a way to configure those params in https://github.com/singer-io/tap-recharge/blob/master/tap_recharge/streams.py (other than forking the repo or submitting a PR)
m
Hello @edgar_ramirez_mondragon, can we achieve this by trying to get the
created_at_min
and
created_at_max
values from configs via
get_url_params
function ? Currently the code look like this.
Copy code
class Subscriptions(CursorPagingStream):
    """
    Retrieves subscriptions from the Recharge API.
    Docs: <https://developer.rechargepayments.com/#list-subscriptions>
    """

    def get_url_params(self, context=None, next_page_token):
        """Return a dictionary of values to be used in URL parameterization.
        If paging is supported, developers may override with specific paging logic.
        Args:
            self:.
        Returns
        -------
            Dictionary of URL query parameters to use in the request. """
        params: dict = {}
        if context:
           params["created_at_min"] = context.get("created_at_min")
           params["created_at_max"] = context.get("created_at_max")
        return params


    tap_stream_id = 'subscriptions'
    key_properties = ['id']
    path = 'subscriptions'
    replication_key = 'updated_at'
    valid_replication_keys = ['updated_at']
    params ={'sort_by':f'{replication_key}-asc'}
    data_key = 'subscriptions'