From 5438edda6ed344552680cdc2d1f6187544c92089 Mon Sep 17 00:00:00 2001 From: a <4184070+MrCurtis@users.noreply.github.com> Date: Thu, 1 Feb 2024 13:29:48 +0000 Subject: [PATCH] Pass table in - it's actually called only_tables --- src/fk_graph/cli.py | 8 ++++++-- tests/test_cli.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/fk_graph/cli.py b/src/fk_graph/cli.py index f687d61..d2f1267 100644 --- a/src/fk_graph/cli.py +++ b/src/fk_graph/cli.py @@ -13,7 +13,11 @@ def main(): setup_data(engine) elif args.connection_string: engine = create_engine(args.connection_string) - graph = get_graph(engine, args.table, args.primary_key) + graph = get_graph( + engine, + args.table, + args.primary_key, + only_tables=args.only_tables) run_app(graph) def _parse_args(): @@ -30,7 +34,7 @@ def _parse_args(): parser.add_argument("--connection-string") parser.add_argument("--table", required=True) parser.add_argument("--primary-key", required=True) - parser.add_argument("--include-only", type=_to_list) + parser.add_argument("--only-tables", type=_to_list) args = parser.parse_args() if ( (not args.demo and args.connection_string is None) diff --git a/tests/test_cli.py b/tests/test_cli.py index 392ecf2..a1a66b3 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -70,7 +70,7 @@ def test_can_pass_in_list_of_tables_to_include(self): " --demo" " --table=table_a" " --primary-key=1" - " --include-only=\"['table_a']\"" + " --only-tables='[\"table_a\"]'" ) # PIPE just stops stdout from printing to screen. process = Popen(shlex_split(command), stdout=PIPE)