From 6256fe517a5db208030e750960da98ea2f2e4e62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= <16805946+edgarrmondragon@users.noreply.github.com> Date: Wed, 10 Jul 2024 12:38:33 -0600 Subject: [PATCH] refactor(templates): Moved class-level attributes to the top in REST tap template (#2528) --- .../{{cookiecutter.library_name}}/rest-client.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/{{cookiecutter.library_name}}/rest-client.py b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/{{cookiecutter.library_name}}/rest-client.py index 16ad9d23f..c7ea7b5ce 100644 --- a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/{{cookiecutter.library_name}}/rest-client.py +++ b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/{{cookiecutter.library_name}}/rest-client.py @@ -55,17 +55,18 @@ class {{ cookiecutter.source_name }}Stream({{ cookiecutter.stream_type }}Stream): """{{ cookiecutter.source_name }} stream class.""" + # Update this value if necessary or override `parse_response`. + records_jsonpath = "$[*]" + + # Update this value if necessary or override `get_new_paginator`. + next_page_token_jsonpath = "$.next_page" # noqa: S105 + @property def url_base(self) -> str: """Return the API URL root, configurable via tap settings.""" # TODO: hardcode a value here, or retrieve it from self.config return "https://api.mysample.com" - records_jsonpath = "$[*]" # Or override `parse_response`. - - # Set this value or override `get_new_paginator`. - next_page_token_jsonpath = "$.next_page" # noqa: S105 - {%- if cookiecutter.auth_method in ("OAuth2", "JWT") %} @cached_property