Skip to content

Commit

Permalink
Use str2bool for use_s3 argument
Browse files Browse the repository at this point in the history
Signed-off-by: Constantin M Adam <[email protected]>
  • Loading branch information
cmadam committed Oct 25, 2024
1 parent d0c6f8a commit 63e11eb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions transforms/universal/fdedup/python/src/fuzzy_dedup_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
)
from data_cleaning_transform_python import DataCleaningPythonTransformConfiguration
from data_processing.runtime.pure_python import PythonTransformLauncher
from data_processing.utils import ParamsUtils, get_logger
from data_processing.utils import ParamsUtils, get_logger, str2bool
from get_duplicate_list_transform_python import (
GetDuplicateListPythonTransformConfiguration,
)
Expand Down Expand Up @@ -159,6 +159,10 @@ def execute_service(self, service_short_name: str, params: list) -> int:
launcher = PythonTransformLauncher(runtime_config=GetDuplicateListPythonTransformConfiguration())
elif service_short_name == "fdclean":
launcher = PythonTransformLauncher(runtime_config=DataCleaningPythonTransformConfiguration())
else:
err_msg = f"Unknown service {service_short_name} specified. Must be one of {SERVICE_DICT.values()}"
self.logger.error(err_msg)
raise ValueError(err_msg)
status = launcher.launch()
return status

Expand Down Expand Up @@ -225,7 +229,8 @@ def parse_args() -> argparse.Namespace:

parser.add_argument(
"--use_s3",
action="store_true",
type=lambda x: bool(str2bool(x)),
default=False,
help="use s3",
)

Expand Down

0 comments on commit 63e11eb

Please sign in to comment.