Skip to content

Commit

Permalink
param cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
fuziontech committed Jan 31, 2024
1 parent b308ad8 commit 093da86
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions housewatch/clickhouse/backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def execute_backup(
query_settings: Dict[str, str | int] = {},
query_id: Optional[str] = None,
substitute_params: bool = True,
cluster: Optional[str] = None,
cluster: Optional[str] = "default",
aws_key: Optional[str] = None,
aws_secret: Optional[str] = None,
base_backup: Optional[str] = None,
Expand Down Expand Up @@ -84,7 +84,7 @@ def get_backup(backup, cluster=None):


def create_table_backup(
database, table, bucket, path, cluster, aws_key=None, aws_secret=None, base_backup=None, is_sharded=False
database, table, bucket, path, aws_key=None, aws_secret=None, base_backup=None, is_sharded=False, cluster="default"
):
if aws_key is None or aws_secret is None:
aws_key = settings.AWS_ACCESS_KEY_ID
Expand Down Expand Up @@ -115,7 +115,7 @@ def create_table_backup(
)


def create_database_backup(database, bucket, path, cluster, aws_key=None, aws_secret=None, base_backup=None):
def create_database_backup(database, bucket, path, aws_key=None, aws_secret=None, base_backup=None, cluster="default"):
if aws_key is None or aws_secret is None:
aws_key = settings.AWS_ACCESS_KEY_ID
aws_secret = settings.AWS_SECRET_ACCESS_KEY
Expand Down Expand Up @@ -159,22 +159,22 @@ def run_backup(backup_id, incremental=False):
backup.database,
backup.bucket,
path,
backup.aws_access_key_id,
backup.aws_secret_access_key,
base_backup=base_backup,
aws_key=backup.aws_access_key_id,
aws_secret=backup.aws_secret_access_key,
cluster=backup.cluster,
base_backup=base_backup,
)
elif backup.is_table_backup():
create_table_backup(
backup.database,
backup.table,
backup.bucket,
path,
backup.aws_access_key_id,
backup.aws_secret_access_key,
aws_key=backup.aws_access_key_id,
aws_secret=backup.aws_secret_access_key,
cluster=backup.cluster,
base_backup=base_backup,
is_sharded=backup.is_sharded,
cluster=backup.cluster,
)
uuid = str(uuid4())
br = ScheduledBackupRun.objects.create(
Expand Down

0 comments on commit 093da86

Please sign in to comment.