Skip to content

Commit

Permalink
fix(pandas): handle non-nullable type mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Nov 20, 2023
1 parent f5f35c6 commit c6a6c56
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions ibis/backends/pandas/execution/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@
dt.timestamp: "datetime64[ns]",
dt.boolean: np.bool_,
dt.json: str,
dt.float16.copy(nullable=False): np.float16,
dt.float32.copy(nullable=False): np.float32,
dt.float64.copy(nullable=False): np.float64,
dt.float32.copy(nullable=False): np.float32,
dt.float64.copy(nullable=False): np.float64,
dt.int8.copy(nullable=False): np.int8,
dt.int16.copy(nullable=False): np.int16,
dt.int32.copy(nullable=False): np.int32,
dt.int64.copy(nullable=False): np.int64,
dt.string.copy(nullable=False): str,
dt.timestamp.copy(nullable=False): "datetime64[ns]",
dt.boolean.copy(nullable=False): np.bool_,
dt.json.copy(nullable=False): str,
}


Expand All @@ -55,6 +68,15 @@
dt.int8: int,
dt.string: str,
dt.date: lambda x: pd.Timestamp(x).to_pydatetime().date(),
dt.boolean.copy(nullable=False): bool,
dt.float64.copy(nullable=False): float,
dt.float32.copy(nullable=False): float,
dt.int64.copy(nullable=False): int,
dt.int32.copy(nullable=False): int,
dt.int16.copy(nullable=False): int,
dt.int8.copy(nullable=False): int,
dt.string.copy(nullable=False): str,
dt.date.copy(nullable=False): lambda x: pd.Timestamp(x).to_pydatetime().date(),
}


Expand Down

0 comments on commit c6a6c56

Please sign in to comment.