diff --git a/.gitignore b/.gitignore index 4680f3c..5985055 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /.pytest_cache __pycache__ -.pyc \ No newline at end of file +.pyc +testings.py \ No newline at end of file diff --git a/dist/pysqltools-0.1.7-py3-none-any.whl b/dist/pysqltools-0.1.7-py3-none-any.whl index f0eae33..9642123 100644 Binary files a/dist/pysqltools-0.1.7-py3-none-any.whl and b/dist/pysqltools-0.1.7-py3-none-any.whl differ diff --git a/dist/pysqltools-0.1.7.tar.gz b/dist/pysqltools-0.1.7.tar.gz index 3a0d27e..daa531d 100644 Binary files a/dist/pysqltools-0.1.7.tar.gz and b/dist/pysqltools-0.1.7.tar.gz differ diff --git a/dist/pysqltools-0.1.8-py3-none-any.whl b/dist/pysqltools-0.1.8-py3-none-any.whl new file mode 100644 index 0000000..5384fb6 Binary files /dev/null and b/dist/pysqltools-0.1.8-py3-none-any.whl differ diff --git a/dist/pysqltools-0.1.8.tar.gz b/dist/pysqltools-0.1.8.tar.gz new file mode 100644 index 0000000..246d0a2 Binary files /dev/null and b/dist/pysqltools-0.1.8.tar.gz differ diff --git a/pyproject.toml b/pyproject.toml index 2ecefdd..88a673b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pysqltools" -version = "0.1.7" +version = "0.1.8" description = "PySQLTools" authors = ["Pablo Minué"] license = "None" diff --git a/pysqltools/src/log/log.py b/pysqltools/src/log/log.py index 08d3cf2..55b5721 100644 --- a/pysqltools/src/log/log.py +++ b/pysqltools/src/log/log.py @@ -27,7 +27,9 @@ class PabLog: """Logger""" - def __init__(self, __format: str = "- %(message)s") -> None: + def __init__( + self, log_name: str = "Logger", __format: str = "- %(message)s" + ) -> None: """Logger Constructor""" self.avaliable_colors = [] self.rich_handler = RichHandler(rich_tracebacks=True) @@ -38,7 +40,7 @@ def __init__(self, __format: str = "- %(message)s") -> None: logging.basicConfig(format=__format, handlers=__handlers, level=logging.DEBUG) - self.log = logging.getLogger() + self.log = logging.getLogger(log_name) self.console = Console() def add_table(self, df: pd.DataFrame, title: str = "", max_rows: int = 10) -> None: diff --git a/pysqltools/src/queries/insert.py b/pysqltools/src/queries/insert.py index 9cf03cc..59d5f05 100644 --- a/pysqltools/src/queries/insert.py +++ b/pysqltools/src/queries/insert.py @@ -91,7 +91,7 @@ def generate_insert_query( previous_iter = 0 while previous_iter < len(df): percentage = round(100 * previous_iter / len(df), 2) - lg.log.info("Generating Insert Queries... %s %", percentage) + lg.log.info("Generating Insert Queries... %s", percentage) batch = df.iloc[previous_iter : previous_iter + batch_size] data_points = list(pandas_to_sql(batch)) data_points_string = ",".join(data_points)