From ec7f946f4b70b8f812ad6f0b987ed15e7427b50d Mon Sep 17 00:00:00 2001 From: Kevin Su Date: Sat, 1 Apr 2023 22:14:47 -0700 Subject: [PATCH 1/2] Automatically remove unused import Signed-off-by: Kevin Su --- Makefile | 1 + dev-requirements.in | 1 + flytekit/clis/flyte_cli/main.py | 1 - flytekit/core/tracker.py | 1 - 4 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 76a790d7b5..b6787e6774 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,7 @@ setup: install-piptools ## Install requirements .PHONY: fmt fmt: ## Format code with black and isort + autoflake --remove-all-unused-imports --ignore-init-module-imports --ignore-pass-after-docstring --in-place -r flytekit/ plugins tests pre-commit run black --all-files || true pre-commit run isort --all-files || true diff --git a/dev-requirements.in b/dev-requirements.in index d69711b05e..78cea49c61 100644 --- a/dev-requirements.in +++ b/dev-requirements.in @@ -29,3 +29,4 @@ scikit-learn types-protobuf types-croniter types-mock +autoflake diff --git a/flytekit/clis/flyte_cli/main.py b/flytekit/clis/flyte_cli/main.py index 21aec1c4ad..47d5c8c641 100644 --- a/flytekit/clis/flyte_cli/main.py +++ b/flytekit/clis/flyte_cli/main.py @@ -1167,7 +1167,6 @@ def terminate_execution(host, insecure, cause, urn=None): raise _click.UsageError('Missing option "-u" / "--urn" or missing pipe inputs.') except KeyboardInterrupt: _sys.stdout.flush() - pass else: _terminate_one_execution(client, urn, cause) diff --git a/flytekit/core/tracker.py b/flytekit/core/tracker.py index 23ff7c9222..1123c57d25 100644 --- a/flytekit/core/tracker.py +++ b/flytekit/core/tracker.py @@ -91,7 +91,6 @@ def find_lhs(self) -> str: # Since dataframes aren't registrable entities to begin with we swallow any errors they raise and # continue looping through m. logger.warning("Caught ValueError {} while attempting to auto-assign name".format(err)) - pass logger.error(f"Could not find LHS for {self} in {self._instantiated_in}") raise _system_exceptions.FlyteSystemException(f"Error looking for LHS in {self._instantiated_in}") From 33755a0bc6766d7173cdcc74215e5820de8c7505 Mon Sep 17 00:00:00 2001 From: Kevin Su Date: Sat, 1 Apr 2023 22:17:24 -0700 Subject: [PATCH 2/2] nit Signed-off-by: Kevin Su --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b6787e6774..2d4d86050b 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ setup: install-piptools ## Install requirements .PHONY: fmt fmt: ## Format code with black and isort - autoflake --remove-all-unused-imports --ignore-init-module-imports --ignore-pass-after-docstring --in-place -r flytekit/ plugins tests + autoflake --remove-all-unused-imports --ignore-init-module-imports --ignore-pass-after-docstring --in-place -r flytekit plugins tests pre-commit run black --all-files || true pre-commit run isort --all-files || true