edponce commented on a change in pull request #9712:
URL: https://github.com/apache/arrow/pull/9712#discussion_r594604228
##########
File path: dev/archery/archery/benchmark/runner.py
##########
@@ -120,11 +120,14 @@ def is_json_result(cls, path_or_str):
@staticmethod
def from_json(path_or_str, **kwargs):
- # breaks recursive imports
- from ..utils.codec import BenchmarkRunnerCodec
- path_or_str, json_load = (open(path_or_str), json.load) \
- if os.path.isfile(path_or_str) else (path_or_str, json.loads)
- return BenchmarkRunnerCodec.decode(json_load(path_or_str), **kwargs)
+ # .codec imported here to break recursive imports
+ from .codec import BenchmarkRunnerCodec
Review comment:
I do not understand the "break recursive imports" comment. I do not see
how this import breaks the function from being called unless it has
side-effects which I am not aware of.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]