Skip to content

Commit ebf9890

Browse files
authored
fix deprecated create for stream for authenticator (#67)
* fix deprecated create for stream for authenticator * deprecate python 3.9, fix linting
1 parent 0d4ec0b commit ebf9890

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ jobs:
5454
fail-fast: false
5555
matrix:
5656
python-version:
57-
- "3.9"
5857
- "3.10"
5958
- "3.11"
6059
- "3.12"

tap_intercom/client.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,17 @@
33
from __future__ import annotations
44

55
import typing as t
6-
from pathlib import Path
7-
from typing import Callable
86

9-
import requests
107
from singer_sdk.authenticators import BearerTokenAuthenticator
118
from singer_sdk.pagination import BaseHATEOASPaginator, JSONPathPaginator
129
from singer_sdk.streams import RESTStream
1310

11+
if t.TYPE_CHECKING:
12+
import requests
13+
1414
T = t.TypeVar("T")
1515
TPageToken = t.TypeVar("TPageToken")
1616

17-
_Auth = Callable[[requests.PreparedRequest], requests.PreparedRequest]
18-
SCHEMAS_DIR = Path(__file__).parent / Path("./schemas")
19-
2017

2118
class IntercomStream(RESTStream):
2219
"""Intercom stream class."""
@@ -32,11 +29,7 @@ def url_base(self) -> str:
3229
@property
3330
def authenticator(self) -> BearerTokenAuthenticator:
3431
"""Return the authenticator."""
35-
access_token = self.config.get("access_token")
36-
if not access_token:
37-
msg = "Access token is required"
38-
raise ValueError(msg)
39-
return BearerTokenAuthenticator.create_for_stream(self, token=access_token)
32+
return BearerTokenAuthenticator(token=self.config["access_token"])
4033

4134
@property
4235
def http_headers(self) -> dict:

0 commit comments

Comments
 (0)