From 69643af04ac0d92a2568289cb428bc68c13923c4 Mon Sep 17 00:00:00 2001 From: jlloyd-widen <82222659+jlloyd-widen@users.noreply.github.com> Date: Thu, 25 May 2023 14:32:10 -0600 Subject: [PATCH] added Optional to necessary params (#34) * added Optional to necessary params * rev up --------- Co-authored-by: Josh Lloyd --- pyproject.toml | 2 +- tap_rest_api_msdk/streams.py | 16 ++++++++-------- tap_rest_api_msdk/utils.py | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e45fec3..4cf75cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "tap-rest-api-msdk" -version = "1.1.2" +version = "1.2.0" description = "`tap-rest-api-msdk` is a Singer tap for REST APIs, built with the Meltano SDK for Singer Taps." authors = ["Josh Lloyd", "Fred Reimer"] keywords = [ diff --git a/tap_rest_api_msdk/streams.py b/tap_rest_api_msdk/streams.py index a6e0895..32f9517 100644 --- a/tap_rest_api_msdk/streams.py +++ b/tap_rest_api_msdk/streams.py @@ -17,16 +17,16 @@ def __init__( name: str, records_path: str, path: str, - params: dict = None, - headers: dict = None, - primary_keys: list = None, - replication_key: str = None, - except_keys: list = None, - next_page_token_path: str = None, - schema: dict = None, + params: Optional[dict] = None, + headers: Optional[dict] = None, + primary_keys: Optional[list] = None, + replication_key: Optional[str] = None, + except_keys: Optional[list] = None, + next_page_token_path: Optional[str] = None, + schema: Optional[dict] = None, pagination_request_style: str = "default", pagination_response_style: str = "default", - pagination_page_size: int = None, + pagination_page_size: Optional[int] = None, ) -> None: """Class initialization. diff --git a/tap_rest_api_msdk/utils.py b/tap_rest_api_msdk/utils.py index 23a8e13..6bae646 100644 --- a/tap_rest_api_msdk/utils.py +++ b/tap_rest_api_msdk/utils.py @@ -1,10 +1,10 @@ """Basic utility functions.""" import json -from typing import Any +from typing import Any, Optional -def flatten_json(obj: dict, except_keys: list = None) -> dict: +def flatten_json(obj: dict, except_keys: Optional[list] = None) -> dict: """Flattens a json object by appending the patch as a key in the returned object. Automatically converts arrays and any provided keys into json strings to prevent