Skip to content

Commit

Permalink
study parser cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dogversioning committed Oct 24, 2023
1 parent 71129f1 commit 578643e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
6 changes: 3 additions & 3 deletions cumulus_library/cli_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def add_table_builder_argument(parser: argparse.ArgumentParser) -> None:
"""Adds --builder arg to a subparser"""
parser.add_argument(
"--builder",
help=(argparse.SUPPRESS),
help=argparse.SUPPRESS,
)


Expand Down Expand Up @@ -129,7 +129,7 @@ def get_parser() -> argparse.ArgumentParser:
clean.add_argument(
"--prefix",
action="store_true",
help=(argparse.SUPPRESS),
help=argparse.SUPPRESS,
)

build = actions.add_parser(
Expand All @@ -145,7 +145,7 @@ def get_parser() -> argparse.ArgumentParser:
build.add_argument(
"--continue",
dest="continue_from",
help=(argparse.SUPPRESS),
help=argparse.SUPPRESS,
)

export = actions.add_parser(
Expand Down
12 changes: 4 additions & 8 deletions cumulus_library/study_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,11 @@ def get_sql_file_list(self, continue_from: str = None) -> Optional[StrList]:
sql_config = self._study_config.get("sql_config", {})
sql_files = sql_config.get("file_names", [])
if continue_from:
match_found = False
for file in sql_files:
print(continue_from.replace(".sql", ""))
print(file.replace(".sql", ""))
for pos, file in enumerate(sql_files):
if continue_from.replace(".sql", "") == file.replace(".sql", ""):
sql_files = sql_files[sql_files.index(file) :]
match_found = True
sql_files = sql_files[pos:]
break
if not match_found:
else:
sys.exit(f"No tables matching '{continue_from}' found")
return sql_files

Expand Down Expand Up @@ -206,7 +202,7 @@ def clean_study(
print("The following views/tables were selected by prefix:")
for view_table in view_table_list:
print(f" {view_table[0]}")
confirm = input("Remove these tables? (Y/N)")
confirm = input("Remove these tables? (y/N)")
if confirm.lower() not in ("y", "yes"):
sys.exit("Table cleaning aborted")
with get_progress_bar(disable=verbose) as progress:
Expand Down

0 comments on commit 578643e

Please sign in to comment.