Aggarwal-Raghav commented on code in PR #444:
URL: https://github.com/apache/tez/pull/444#discussion_r2548993387
##########
tez-tools/counter-diff/counter-diff.py:
##########
@@ -47,28 +52,33 @@ def diff(file1, file2):
# also in dag.json data is inside "dag" root node
file1_using_dag_json = True
dag_json_file1 = os.path.join(file1_dir, "dag.json")
- if os.path.isfile(dag_json_file1) == False:
+ if not os.path.isfile(dag_json_file1):
file1_using_dag_json = False
dag_json_file1 = os.path.join(file1_dir, "TEZ_DAG")
- if os.path.isfile(dag_json_file1) == False:
- print "Unable to find dag.json/TEZ_DAG file inside the
archive " + file1
- exit()
+ if not os.path.isfile(dag_json_file1):
+ print("Unable to find dag.json/TEZ_DAG file inside the
archive " + file1)
+ sys.exit()
file2_using_dag_json = True
dag_json_file2 = os.path.join(file2_dir, "dag.json")
- if os.path.isfile(dag_json_file2) == False:
+ if not os.path.isfile(dag_json_file2):
file2_using_dag_json = False
dag_json_file2 = os.path.join(file2_dir, "TEZ_DAG")
- if os.path.isfile(dag_json_file2) == False:
- print "Unable to find dag.json/TEZ_DAG file inside the
archive " + file1
- exit()
+ if not os.path.isfile(dag_json_file2):
+ print("Unable to find dag.json/TEZ_DAG file inside the
archive " + file1)
+ sys.exit()
# populate diff table
difftable = {}
with open(dag_json_file1) as data_file:
file1_dag_json = json.load(data_file)["dag"] if
file1_using_dag_json else json.load(data_file)
- counters = file1_dag_json['otherinfo']['counters']
- for group in counters['counterGroups']:
Review Comment:
Added safe check because of such errors
<img width="461" height="413" alt="Image"
src="https://github.com/user-attachments/assets/82922ada-d28c-47b8-bbfb-bba5597963b6"
/>
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]