Skip to content

Commit

Permalink
Added more keywords to exclude table aliases from.
Browse files Browse the repository at this point in the history
Exclude tests directory from package installation.
  • Loading branch information
wongjingping committed Jun 7, 2024
1 parent dd51899 commit a127520
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions defog_utils/utils_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
description="Various helper functions used by Defog projects",
author="defog",
author_email="[email protected]",
packages=find_packages(),
packages=find_packages(exclude=["tests"]),
install_requires=[
"numpy",
"sqlglot",
Expand Down

0 comments on commit a127520

Please sign in to comment.