Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import zlib
from contextlib import closing
from dataclasses import InitVar, dataclass
from math import nan
from typing import Any, Dict, Iterable, Mapping, Optional, Tuple

import pandas as pd
import requests
from numpy import nan

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

Expand Down
6 changes: 2 additions & 4 deletions airbyte_cdk/sources/file_based/file_types/excel_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

import orjson
import pandas as pd
from numpy import datetime64, issubdtype
from numpy import dtype as dtype_
from pydantic.v1 import BaseModel

from airbyte_cdk.sources.file_based.config.file_based_stream_config import (
Expand Down Expand Up @@ -141,7 +139,7 @@ def file_read_mode(self) -> FileReadMode:
@staticmethod
def dtype_to_json_type(
current_type: Optional[str],
dtype: dtype_, # type: ignore [type-arg]
dtype: Any, # Type object from pandas DataFrame
) -> str:
"""
Convert Pandas DataFrame types to Airbyte Types.
Expand All @@ -163,7 +161,7 @@ def dtype_to_json_type(
return "number"
if dtype == "bool" and (not current_type or current_type == "boolean"):
return "boolean"
if issubdtype(dtype, datetime64):
if pd.api.types.is_datetime64_any_dtype(dtype):
return "date-time"
return "string"

Expand Down
Loading
Loading