pitrou commented on a change in pull request #9712:
URL: https://github.com/apache/arrow/pull/9712#discussion_r594606177
##########
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:
In Python, recursive imports are only bothersome at the top level.
Otherwise they work just fine.
----------------------------------------------------------------
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]