Skip to content

Commit 041c201

Browse files
pnilanCopilot
andauthored
chore: update jsonref, remove numpy dep, update ddtrace (#800)
Co-authored-by: Copilot <[email protected]>
1 parent 55ea028 commit 041c201

File tree

4 files changed

+93
-85
lines changed

4 files changed

+93
-85
lines changed

airbyte_cdk/sources/declarative/extractors/response_to_file_extractor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
import zlib
88
from contextlib import closing
99
from dataclasses import InitVar, dataclass
10+
from math import nan
1011
from typing import Any, Dict, Iterable, Mapping, Optional, Tuple
1112

1213
import pandas as pd
1314
import requests
14-
from numpy import nan
1515

1616
from airbyte_cdk.sources.declarative.extractors.record_extractor import RecordExtractor
1717

airbyte_cdk/sources/file_based/file_types/excel_parser.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
import orjson
1111
import pandas as pd
12-
from numpy import datetime64, issubdtype
13-
from numpy import dtype as dtype_
1412
from pydantic.v1 import BaseModel
1513

1614
from airbyte_cdk.sources.file_based.config.file_based_stream_config import (
@@ -141,7 +139,7 @@ def file_read_mode(self) -> FileReadMode:
141139
@staticmethod
142140
def dtype_to_json_type(
143141
current_type: Optional[str],
144-
dtype: dtype_, # type: ignore [type-arg]
142+
dtype: Any, # Type object from pandas DataFrame
145143
) -> str:
146144
"""
147145
Convert Pandas DataFrame types to Airbyte Types.
@@ -163,7 +161,7 @@ def dtype_to_json_type(
163161
return "number"
164162
if dtype == "bool" and (not current_type or current_type == "boolean"):
165163
return "boolean"
166-
if issubdtype(dtype, datetime64):
164+
if pd.api.types.is_datetime64_any_dtype(dtype):
167165
return "date-time"
168166
return "string"
169167

0 commit comments

Comments
 (0)