Alex-PLACET commented on code in PR #46530: URL: https://github.com/apache/arrow/pull/46530#discussion_r2111241542
########## dev/archery/archery/cli.py: ########## @@ -844,29 +868,28 @@ def integration(with_all=False, random_seed=12345, **args): implementations = ['cpp', 'csharp', 'java', 'js', 'go', 'nanoarrow', 'rust'] formats = ['ipc', 'flight', 'c_data'] - enabled_implementations = 0 + enabled_implementations : bool = False for lang in implementations: param = f'with_{lang}' if with_all: args[param] = with_all - enabled_implementations += args[param] + enabled_implementations = True - enabled_formats = 0 + enabled_formats : bool = False for fmt in formats: - param = f'run_{fmt}' - enabled_formats += args[param] + enabled_formats = True if gen_path: # XXX See GH-37575: this option is only used by the JS test suite # and might not be useful anymore. os.makedirs(gen_path, exist_ok=True) write_js_test_json(gen_path) else: - if enabled_formats == 0: + if enabled_formats == False: Review Comment: I finally simplified the code to raise an error if no format is selected ########## dev/archery/archery/cli.py: ########## @@ -844,29 +868,28 @@ def integration(with_all=False, random_seed=12345, **args): implementations = ['cpp', 'csharp', 'java', 'js', 'go', 'nanoarrow', 'rust'] formats = ['ipc', 'flight', 'c_data'] - enabled_implementations = 0 + enabled_implementations : bool = False for lang in implementations: param = f'with_{lang}' if with_all: args[param] = with_all - enabled_implementations += args[param] + enabled_implementations = True - enabled_formats = 0 + enabled_formats : bool = False for fmt in formats: - param = f'run_{fmt}' - enabled_formats += args[param] + enabled_formats = True if gen_path: # XXX See GH-37575: this option is only used by the JS test suite # and might not be useful anymore. os.makedirs(gen_path, exist_ok=True) write_js_test_json(gen_path) else: - if enabled_formats == 0: + if enabled_formats == False: raise click.UsageError( "Need to enable at least one format to test " "(IPC, Flight, C Data Interface); try --help") - if enabled_implementations == 0: + if enabled_implementations == False: Review Comment: fixed -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org