Commits


Philip authored and GitHub committed f794b208ce7
MINOR: [Archery] Fixed ArrowSources.__str__() not returning string (#35386) ### Rationale for this change When no git repository is initialised in the `arrow/` directory, archery is supposed to raise an error when executing for example `archery benchmark list`. This error raises another error because the class ArrowSources does not have a proper `__repr__()` method. Below an example traceback: ```sh Traceback (most recent call last): File "/opt/homebrew/bin/archery", line 33, in <module> sys.exit(load_entry_point('archery', 'console_scripts', 'archery')()) File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) File "/opt/homebrew/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), *args, **kwargs) File "/Users/philipgroet/projects/afstuderen/arrow/dev/archery/archery/cli.py", line 419, in benchmark_list runner_base = CppBenchmarkRunner.from_rev_or_path( File "/Users/philipgroet/projects/afstuderen/arrow/dev/archery/archery/benchmark/runner.py", line 222, in from_rev_or_path src_rev, _ = src.at_revision(rev_or_path, clone_dir) File "/Users/philipgroet/projects/afstuderen/arrow/dev/archery/archery/utils/source.py", line 151, in at_revision raise ValueError("{} is not backed by git".format(self)) TypeError: __str__ returned non-string (type PosixPath) ``` ### What changes are included in this PR? The `self.path` attribute of ArrowSources is of type Path, we stringify it. ### Are these changes tested? Yes, now prints: `ValueError: /Users/philipgroet/projects/afstuderen/arrow is not backed by git` ### Are there any user-facing changes? No, bugfix Authored-by: Philip Groet <philip.groet@gmail.com> Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>