Skip to content

Commit

Permalink
fixed linting errors, rev 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jlloyd-widen committed Sep 4, 2024
1 parent f51612e commit cec080f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tap-rest-api-msdk"
version = "1.3.11"
version = "1.4.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 = [
Expand Down
4 changes: 2 additions & 2 deletions tap_rest_api_msdk/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ def get_aws_session_client(self):

class ConfigurableOAuthAuthenticator(OAuthAuthenticator):
"""Configurable OAuth Authenticator."""

def get_initial_oauth_token(self):
"""Gets a oauth token for the tap schema discovery.
"""Get oauth token for the tap schema discovery.
Requests an oauth token and sets the auth headers.
"""
Expand Down
11 changes: 7 additions & 4 deletions tap_rest_api_msdk/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

import copy
import json
from typing import Any, List
from typing import Any, List, Optional

import requests
from genson import SchemaBuilder
from singer_sdk import Tap
from singer_sdk import typing as th
from singer_sdk.authenticators import APIAuthenticatorBase
from singer_sdk.helpers.jsonpath import extract_jsonpath
from tap_rest_api_msdk.auth import get_authenticator
from tap_rest_api_msdk.auth import ConfigurableOAuthAuthenticator, get_authenticator
from tap_rest_api_msdk.streams import DynamicStream
from tap_rest_api_msdk.utils import flatten_json

Expand All @@ -24,7 +25,7 @@ class TapRestApiMsdk(Tap):

# Used to cache the Authenticator to prevent over hitting the Authentication
# end-point for each stream.
_authenticator = None
_authenticator: Optional[APIAuthenticatorBase] = None

common_properties = th.PropertiesList(
th.Property(
Expand Down Expand Up @@ -583,7 +584,9 @@ def get_schema(
get_authenticator(self)

# Get an initial oauth token if an oauth method
if auth_method == 'oauth':
if auth_method == "oauth" and isinstance(
self._authenticator, ConfigurableOAuthAuthenticator
):
self._authenticator.get_initial_oauth_token()

headers.update(getattr(self._authenticator, "auth_headers", {}))
Expand Down

0 comments on commit cec080f

Please sign in to comment.