Skip to content

Commit

Permalink
Update fast_upload.py
Browse files Browse the repository at this point in the history
* Add pandas_types
  • Loading branch information
jzsmoreno committed Nov 15, 2023
1 parent d2443d2 commit a2ccda6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
24 changes: 22 additions & 2 deletions pydbsmgr/fast_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,28 @@
class DataFrameToSQL:
"""Allows you to create a table from a dataframe"""

sql_types = ["FLOAT", "INT", "BIGINT", "DATE", "VARCHAR(MAX)", "BIT"]
pandas_types = ["float64", "int32", "int64", "datetime64[ns]", "object", "bool"]
sql_types = [
"FLOAT",
"INT",
"BIGINT",
"DATE",
"VARCHAR(MAX)",
"BIT",
"VARCHAR(MAX)",
"INT",
"BIGINT",
]
pandas_types = [
"float64",
"int32",
"int64",
"datetime64[ns]",
"object",
"bool",
"category",
"Int32",
"Int64",
]
datatype_dict = dict(zip(pandas_types, sql_types))

def __init__(self, connection_string: str) -> None:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="pydbsmgr",
version="0.7.0",
version="0.7.1",
author="J. A. Moreno-Guerra",
author_email="[email protected]",
description="Testing installation of Package",
Expand Down

0 comments on commit a2ccda6

Please sign in to comment.