How to use the pantab._compat.PANDAS_100 function in pantab

To help you get started, we’ve selected a few pantab examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github innobi / pantab / pantab / _types.py View on Github external
"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

pantab

Converts pandas DataFrames into Tableau Hyper Extracts and back

BSD-3-Clause
Latest version published 1 month ago

Package Health Score

87 / 100
Full package analysis

Similar packages