Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"float32": _ColumnType(tab_api.SqlType.double(), tab_api.Nullability.NULLABLE),
"float64": _ColumnType(tab_api.SqlType.double(), tab_api.Nullability.NULLABLE),
"bool": _ColumnType(tab_api.SqlType.bool(), tab_api.Nullability.NOT_NULLABLE),
"datetime64[ns]": _ColumnType(
tab_api.SqlType.timestamp(), tab_api.Nullability.NULLABLE
),
"datetime64[ns, UTC]": _ColumnType(
tab_api.SqlType.timestamp_tz(), tab_api.Nullability.NULLABLE
),
"timedelta64[ns]": _ColumnType(
tab_api.SqlType.interval(), tab_api.Nullability.NULLABLE
),
"object": _ColumnType(tab_api.SqlType.text(), tab_api.Nullability.NULLABLE),
}
if compat.PANDAS_100:
_column_types["string"] = _ColumnType(
tab_api.SqlType.text(), tab_api.Nullability.NULLABLE
)
_column_types["boolean"] = _ColumnType(
tab_api.SqlType.bool(), tab_api.Nullability.NULLABLE
)
else:
_column_types["object"] = _ColumnType(
tab_api.SqlType.text(), tab_api.Nullability.NULLABLE
)
# Invert this, but exclude float32 as that does not roundtrip
_pandas_types = {v: k for k, v in _column_types.items() if k != "float32"}
# Add things that we can't write to Hyper but can read