Skip to content

Commit f4b0911

Browse files
authored
Merge branch 'main' into inahga/zizmor
2 parents 639199d + e6778db commit f4b0911

4 files changed

Lines changed: 13 additions & 8 deletions

File tree

partitionmanager/cli.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,7 @@ def do_partition(conf):
353353

354354
except partitionmanager.types.NoEmptyPartitionsAvailableException:
355355
log.warning(
356-
"Unable to automatically handle %s: No empty "
357-
"partition is available.",
356+
"Unable to automatically handle %s: No empty partition is available.",
358357
table,
359358
)
360359
except partitionmanager.types.DatabaseCommandException as e:

partitionmanager/dropper_test.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,11 @@ def test_no_droppable_partitions(self):
8080
table.set_retention_period(timedelta(days=2))
8181
current_timestamp = datetime(2021, 1, 1, tzinfo=timezone.utc)
8282
current_position = PositionPartition("p_20210102").set_position([10])
83-
assert {} == get_droppable_partitions(
84-
database, [], current_position, current_timestamp, table
83+
assert (
84+
get_droppable_partitions(
85+
database, [], current_position, current_timestamp, table
86+
)
87+
== {}
8588
)
8689

8790
def test_get_droppable_partitions(self):

partitionmanager/stats.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ def get_statistics(partitions, current_timestamp, table):
113113
log.debug(f"{table} had partitions that aren't comparable: {a} and {b}")
114114
continue
115115
d = b.timestamp() - a.timestamp()
116-
if d > max_d:
117-
max_d = d
116+
max_d = max(max_d, d)
118117

119118
if max_d > timedelta():
120119
results["max_partition_delta"] = max_d

pyproject.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,12 @@ select = [
101101
# "TRY", # tryceratops
102102
]
103103
ignore = [
104-
"ISC001", # Implicit string concatenation can conflict with ruff format
105-
"S101", # Allow assert statements
104+
"ISC001", # Implicit string concatenation can conflict with ruff format
105+
"S101", # Allow assert statements
106+
"LOG015", # Call on root logger
107+
"BLE001", # Do not catch blind exception
108+
"PLW1641", # Object does not implement __hash__ method
109+
"PLC0415", # import should be at the top-level of a file
106110
]
107111

108112
[tool.ruff.lint.mccabe]

0 commit comments

Comments
 (0)