Skip to content

Commit

Permalink
support 25.1 (#204)
Browse files Browse the repository at this point in the history
* init

* fix style

* fix style

---------

Co-authored-by: kst-morozov <[email protected]>
  • Loading branch information
k-morozov and kst-morozov authored Feb 5, 2025
1 parent d1990ef commit 84ce51d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion ch_backup/clickhouse/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,11 +976,26 @@ def _make_table(self, record: dict) -> Table:
if "MergeTree" in record.get("engine", "")
else []
),
metadata_path=record.get("metadata_path", None),
metadata_path=self._get_metadata_path(record),
create_statement=record["create_table_query"],
uuid=record.get("uuid", None),
)

def _get_metadata_path(self, record: dict) -> str:
metadata_path = record.get("metadata_path", None)
if metadata_path is None:
return ""

if not self.ch_version_ge("25.1"):
return metadata_path

default_disk = self._disks.get("default")

if default_disk is not None:
metadata_path = default_disk.path + metadata_path

return metadata_path

def read_s3_disk_revision(self, disk_name: str, backup_name: str) -> Optional[int]:
"""
Reads S3 disk revision counter.
Expand Down

0 comments on commit 84ce51d

Please sign in to comment.