Skip to content

Commit

Permalink
Change list annotation to typing.List
Browse files Browse the repository at this point in the history
  • Loading branch information
Eden-D-Zhang committed Jan 29, 2025
1 parent a9e12af commit 8680126
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
import subprocess
import sys
import typing
from pathlib import Path

from clp_py_utils.clp_config import StorageType
Expand Down Expand Up @@ -180,17 +181,17 @@ def main(argv):
container_clp_config, clp_config, container_name
)

necessary_mounts: list[CLPDockerMounts] = [
necessary_mounts: typing.List[CLPDockerMounts] = [
mounts.clp_home,
mounts.logs_dir,
mounts.archives_output_dir,
]
container_start_cmd: list[str] = generate_container_start_cmd(
container_start_cmd: typing.List[str] = generate_container_start_cmd(
container_name, necessary_mounts, clp_config.execution_container
)

# fmt: off
archive_manager_cmd: list[str] = [
archive_manager_cmd: typing.List[str] = [
"python3",
"-m", "clp_package_utils.scripts.native.archive_manager",
"--config", str(generated_config_path_on_container),
Expand Down Expand Up @@ -220,7 +221,7 @@ def main(argv):
else:
logger.error(f"Unsupported subcommand: `{subcommand}`.")

cmd: list[str] = container_start_cmd + archive_manager_cmd
cmd: typing.List[str] = container_start_cmd + archive_manager_cmd

subprocess.run(cmd, check=True)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import logging
import shutil
import sys
import typing
from abc import ABC, abstractmethod
from contextlib import closing
from pathlib import Path
from typing import List

from clp_py_utils.clp_config import Database
from clp_py_utils.sql_adapter import SQL_Adapter
Expand Down Expand Up @@ -252,7 +252,7 @@ def _find_archives(
db_cursor.execute(query, query_params)
results = db_cursor.fetchall()

archive_ids: list[str] = [result["id"] for result in results]
archive_ids: typing.List[str] = [result["id"] for result in results]
if 0 == len(archive_ids):
logger.info("No archives found within specified time range.")
return 0
Expand Down Expand Up @@ -318,7 +318,7 @@ def _delete_archives(
logger.info(delete_handler.get_not_found_message)
return 0

archive_ids: list[str] = [result["id"] for result in results]
archive_ids: typing.List[str] = [result["id"] for result in results]
delete_handler.validate_results(archive_ids)

ids_list_string: str = ",".join(["%s"] * len(archive_ids))
Expand Down

0 comments on commit 8680126

Please sign in to comment.