Skip to content

Commit bee9f67

Browse files
committed
Corrected according to PR comments
1 parent ba8f8be commit bee9f67

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

functions-python/pmtiles_builder/src/csv_cache.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import logging
1818
import os
1919
import subprocess
20-
import sys
2120
from pathlib import Path
2221
from typing import TypedDict, List, Dict
2322

@@ -42,7 +41,7 @@ class ShapeTrips(TypedDict):
4241
trip_ids: List[str]
4342

4443

45-
def print_df(mountpoint: str):
44+
def get_volume_size(mountpoint: str):
4645
"""
4746
Returns the total size of the specified filesystem mount point in a human-readable format.
4847
@@ -61,7 +60,7 @@ def print_df(mountpoint: str):
6160
"""
6261
mp = Path(mountpoint)
6362
if not mp.exists():
64-
print(f"Mountpoint not found: {mp}", file=sys.stderr)
63+
logging.warning("Mountpoint not found: %s", mountpoint)
6564
return "N/A"
6665
cmd = [
6766
"bash",
@@ -105,7 +104,7 @@ def __init__(
105104
self.trips_no_shapes_per_route: Dict[str, List[str]] = {}
106105

107106
self.logger.info("Using work directory: %s", self.workdir)
108-
self.logger.info("Size of workdir: %s", print_df(self.workdir))
107+
self.logger.info("Size of workdir: %s", get_volume_size(self.workdir))
109108

110109
def debug_log_size(self, label: str, obj: object) -> None:
111110
"""Log the deep size of an object in bytes when DEBUG is enabled."""

0 commit comments

Comments
 (0)