Skip to content

Commit 5e698ae

Browse files
authored
fix flake8 style (#7939)
1 parent 43292f3 commit 5e698ae

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

ydb/apps/dstool/lib/arg_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def _additional_eq(self, other):
9797

9898
def __eq__(self, other):
9999
return all((
100-
type(self) == type(other),
100+
type(self) is type(other),
101101
self.name == other.name,
102102
self.type == other.type,
103103
self.choices == other.choices,

ydb/apps/dstool/lib/common.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,20 +818,23 @@ def fetch_json_info(entity, nodes=None, enums=1):
818818
elif entity == 'vdiskinfo':
819819
section, keycols = 'VDiskStateInfo', ['NodeId', 'PDiskId', 'VDiskSlotId']
820820

821-
def merge(x, y):
821+
def merge_fn(x, y):
822822
return max([x, y], key=lambda x: x.get('GroupGeneration', 0))
823+
merge = merge_fn
823824
elif entity == 'tabletinfo':
824825
section, keycols = 'TabletStateInfo', ['TabletId']
825826

826-
def merge(x, y):
827+
def merge_fn(x, y):
827828
return max([x, y], key=lambda x: x.get('Generation', 0))
829+
merge = merge_fn
828830
elif entity == 'bsgroupinfo':
829831
section, keycols = 'BSGroupStateInfo', ['GroupID']
830832

831-
def merge(x, y):
833+
def merge_fn(x, y):
832834
return x if x.get('GroupGeneration', 0) > y.get('GroupGeneration', 0) else \
833835
y if y.get('GroupGeneration', 0) > x.get('GroupGeneration', 0) else \
834836
x if x.get('VDiskIds', []) else y
837+
merge = merge_fn
835838
else:
836839
assert False
837840
res = {}

ydb/library/yql/core/expr_nodes_gen/gen/__main__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import os
22
import sys
3-
import getopt
43
import json
54
import re
65

@@ -17,7 +16,7 @@
1716
env = Environment(loader=FileSystemLoader(templateDir))
1817
template = env.get_template(templateFilename)
1918

20-
json_data=open(jsonFile)
19+
json_data = open(jsonFile)
2120
model = json.load(json_data)
2221
json_data.close()
2322

@@ -51,7 +50,7 @@
5150
child["Optional"] = False
5251

5352
if node["Base"] == model["FreeArgCallableBase"]:
54-
aux["isFinal"] = True;
53+
aux["isFinal"] = True
5554

5655
# Traverse tree
5756
nodesMap = {}
@@ -135,7 +134,7 @@ def isListBuilder(node):
135134
raise Exception("Child #" + str(index) + " should be optional in " + node["Name"])
136135
optionalArgs = child["Optional"]
137136
if not child["Optional"]:
138-
aux["fixedChildrenCount"] += 1;
137+
aux["fixedChildrenCount"] += 1
139138

140139
if "Match" in node and node["Match"]["Type"] == "CallableBase":
141140
namesToMatch = aux["namesToMatch"] = []
@@ -202,4 +201,3 @@ def addUsages(typename):
202201
defsOutput = template.render(generator=__file__, genType="Definitions", model=model, nodes=model["Nodes"])
203202
with open(defsOutFile, "w") as fh:
204203
fh.write(defsOutput)
205-

0 commit comments

Comments
 (0)