Skip to content

Commit 820c1a9

Browse files
committed
feat: add logging for unknown field removal in response handling
1 parent c827f61 commit 820c1a9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

dlt_source_affinity/rest_client.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import logging
23
from typing import Any
34

45
import dlt
@@ -17,6 +18,9 @@
1718
# Share a session (and thus pool) between all rest clients
1819
session: Session = None
1920

21+
# logger = logging.getLogger(__name__)
22+
logger = logging.getLogger("dlt")
23+
2024

2125
def get_v2_rest_client(
2226
api_key: str = dlt.secrets["affinity_api_key"],
@@ -94,6 +98,9 @@ def remove_unknown_fields(response: Response, *args: Any, **kwargs: Any) -> None
9498
isinstance(field, dict)
9599
and field["value"]["type"] not in ValueType
96100
):
101+
logger.warning(
102+
f"Removing field with unknown type: {field['value']['type']}"
103+
)
97104
to_remove.append(field)
98105
changed = True
99106
for field in to_remove:

0 commit comments

Comments
 (0)