Skip to content

Commit baa11ea

Browse files
committed
linter
1 parent 88ce29e commit baa11ea

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

services/dask-sidecar/src/simcore_service_dask_sidecar/utils/files.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from settings_library.s3 import S3Settings
2121
from yarl import URL
2222

23-
logger = logging.getLogger(__name__)
23+
_logger = logging.getLogger(__name__)
2424

2525
HTTP_FILE_SYSTEM_SCHEMES: Final = ["http", "https"]
2626
S3_FILE_SYSTEM_SCHEMES: Final = ["s3", "s3a"]
@@ -208,7 +208,7 @@ async def pull_file_from_remote(
208208
await log_publishing_cb(
209209
f"Uncompressing '{download_dst_path.name}'...", logging.INFO
210210
)
211-
logger.debug(
211+
_logger.debug(
212212
"%s is a zip file and will be now uncompressed", download_dst_path
213213
)
214214
with repro_zipfile.ReproducibleZipFile(download_dst_path, "r") as zip_obj:
@@ -258,7 +258,7 @@ async def _push_file_to_remote(
258258
log_publishing_cb: LogPublishingCB,
259259
s3_settings: S3Settings | None,
260260
) -> None:
261-
logger.debug("Uploading %s to %s...", file_to_upload, dst_url)
261+
_logger.debug("Uploading %s to %s...", file_to_upload, dst_url)
262262
assert dst_url.path # nosec
263263

264264
storage_kwargs: S3FsSettingsDict | dict[str, Any] = {}
@@ -306,7 +306,7 @@ async def push_file_to_remote(
306306
await asyncio.get_event_loop().run_in_executor(
307307
None, zfp.write, src_path, src_path.name
308308
)
309-
logger.debug("%s created.", archive_file_path)
309+
_logger.debug("%s created.", archive_file_path)
310310
assert archive_file_path.exists() # nosec
311311
file_to_upload = archive_file_path
312312
await log_publishing_cb(
@@ -319,7 +319,7 @@ async def push_file_to_remote(
319319
)
320320

321321
if dst_url.scheme in HTTP_FILE_SYSTEM_SCHEMES:
322-
logger.debug("destination is a http presigned link")
322+
_logger.debug("destination is a http presigned link")
323323
await _push_file_to_http_link(file_to_upload, dst_url, log_publishing_cb)
324324
else:
325325
await _push_file_to_remote(

services/dask-sidecar/tests/unit/test_utils_files.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,9 @@ async def test_log_partial_file_content(
526526

527527
# Case 1: file longer than max_chars
528528
with caplog.at_level(logging.DEBUG, logger=logger.name):
529-
await log_partial_file_content(file_path, logger, logging.DEBUG, max_chars=10)
529+
await log_partial_file_content(
530+
file_path, logger=logger, log_level=logging.DEBUG, max_chars=10
531+
)
530532
assert any(
531533
"file content (truncated): abcdefghij..." in record.getMessage()
532534
for record in caplog.records
@@ -538,7 +540,9 @@ async def test_log_partial_file_content(
538540
short_file = tmp_path / "short.txt"
539541
short_file.write_text(short_content)
540542
with caplog.at_level(logging.DEBUG, logger=logger.name):
541-
await log_partial_file_content(short_file, logger, logging.DEBUG, max_chars=10)
543+
await log_partial_file_content(
544+
short_file, logger=logger, log_level=logging.DEBUG, max_chars=10
545+
)
542546
assert any(
543547
"file content: short" in record.getMessage() for record in caplog.records
544548
)
@@ -548,7 +552,7 @@ async def test_log_partial_file_content(
548552
non_existent = tmp_path / "doesnotexist.txt"
549553
with caplog.at_level(logging.DEBUG, logger=logger.name):
550554
await log_partial_file_content(
551-
non_existent, logger, logging.DEBUG, max_chars=10
555+
non_existent, logger=logger, log_level=logging.DEBUG, max_chars=10
552556
)
553557
assert any(
554558
f"file does not exist: {non_existent}" in record.getMessage()

0 commit comments

Comments
 (0)