From a127520670dd2b6f4d99604297db6cf49de2d955 Mon Sep 17 00:00:00 2001 From: JP Date: Fri, 7 Jun 2024 01:23:54 +0000 Subject: [PATCH] Added more keywords to exclude table aliases from. Exclude tests directory from package installation. --- defog_utils/utils_db.py | 11 +++++++++++ setup.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/defog_utils/utils_db.py b/defog_utils/utils_db.py index bf622ad..1661c22 100644 --- a/defog_utils/utils_db.py +++ b/defog_utils/utils_db.py @@ -18,14 +18,23 @@ } reserved_keywords = [ + "abs", "all", "and", "any", + "avg", "as", + "at", "asc", + "bit", + "by", + "day", + "dec", "do", + "div", "end", "for", + "go", "in", "is", "not", @@ -456,8 +465,10 @@ def generate_aliases( for original_table_name in table_names: if "." in original_table_name: table_name = original_table_name.rsplit(".", 1)[-1] + print(f"split: {original_table_name.rsplit('.', 1)}") else: table_name = original_table_name + print(f"original: {table_name}") if "_" in table_name: # get the first letter of each subword delimited by "_" alias = "".join([word[0] for word in table_name.split("_")]).lower() diff --git a/setup.py b/setup.py index 2806402..84398f8 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ description="Various helper functions used by Defog projects", author="defog", author_email="support@defog.ai", - packages=find_packages(), + packages=find_packages(exclude=["tests"]), install_requires=[ "numpy", "sqlglot",