Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions partitionmanager/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,7 @@ def do_partition(conf):

except partitionmanager.types.NoEmptyPartitionsAvailableException:
log.warning(
"Unable to automatically handle %s: No empty "
"partition is available.",
"Unable to automatically handle %s: No empty partition is available.",
table,
)
except partitionmanager.types.DatabaseCommandException as e:
Expand Down
7 changes: 5 additions & 2 deletions partitionmanager/dropper_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,11 @@ def test_no_droppable_partitions(self):
table.set_retention_period(timedelta(days=2))
current_timestamp = datetime(2021, 1, 1, tzinfo=timezone.utc)
current_position = PositionPartition("p_20210102").set_position([10])
assert {} == get_droppable_partitions(
database, [], current_position, current_timestamp, table
assert (
get_droppable_partitions(
database, [], current_position, current_timestamp, table
)
== {}
)

def test_get_droppable_partitions(self):
Expand Down
3 changes: 1 addition & 2 deletions partitionmanager/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def get_statistics(partitions, current_timestamp, table):
log.debug(f"{table} had partitions that aren't comparable: {a} and {b}")
continue
d = b.timestamp() - a.timestamp()
if d > max_d:
max_d = d
max_d = max(max_d, d)

if max_d > timedelta():
results["max_partition_delta"] = max_d
Expand Down
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,12 @@ select = [
# "TRY", # tryceratops
]
ignore = [
"ISC001", # Implicit string concatenation can conflict with ruff format
"S101", # Allow assert statements
"ISC001", # Implicit string concatenation can conflict with ruff format
"S101", # Allow assert statements
"LOG015", # Call on root logger
"BLE001", # Do not catch blind exception
"PLW1641", # Object does not implement __hash__ method
"PLC0415", # import should be at the top-level of a file
]

[tool.ruff.lint.mccabe]
Expand Down