We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a6cd33 commit e24c9daCopy full SHA for e24c9da
sqlmesh/utils/pandas.py
@@ -27,10 +27,17 @@
27
pd.Float32Dtype(): exp.DataType.build("float"),
28
pd.Float64Dtype(): exp.DataType.build("double"),
29
pd.StringDtype(): exp.DataType.build("text"), # type: ignore
30
- pd.StringDtype("pyarrow"): exp.DataType.build("text"),
31
pd.BooleanDtype(): exp.DataType.build("boolean"),
32
}
33
+try:
34
+ import pyarrow # type: ignore # noqa
35
+
36
+ # Only add this if pyarrow is installed
37
+ PANDAS_TYPE_MAPPINGS[pd.StringDtype("pyarrow")] = exp.DataType.build("text")
38
+except ImportError:
39
+ pass
40
41
42
def columns_to_types_from_df(df: pd.DataFrame) -> t.Dict[str, exp.DataType]:
43
return columns_to_types_from_dtypes(df.dtypes.items())
0 commit comments