Skip to content

Commit 4d50855

Browse files
Fix padding
1 parent c4bba1b commit 4d50855

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

samples/inference-failover/inference_failover_helpers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99
from tempfile import gettempdir
1010
from typing import Any
1111

12+
# APIM Samples imports
13+
import charts
1214
import matplotlib.pyplot as plt
1315
import pandas as pd
1416
import requests as http_requests
15-
16-
# APIM Samples imports
17-
import charts
1817
from apimtesting import ApimTesting
1918
from apimtypes import SUBSCRIPTION_KEY_PARAMETER_NAME
2019
from console import print_info, print_message, print_warning

shared/python/console.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,13 @@ def print_warning(msg: str, output: str = '', duration: str = '') -> None:
205205

206206
def print_val(name: str, value: str, val_below: bool = False) -> None:
207207
"""Print a key-value pair."""
208-
_print_log(f'{name:<_PAD_MAX}:{"\n" if val_below else " "}{value}', '👉 ', BOLD_B, wrap_lines=True, level=logging.INFO)
208+
_print_log(f'{name:<{_PAD_MAX}}:{"\n" if val_below else " "}{value}', '👉 ', BOLD_B, wrap_lines=True, level=logging.INFO)
209209

210210

211211
def print_secret(name: str, value: str) -> None:
212212
"""Print a key-value pair with the value masked, showing only its length."""
213213
masked = f'***REDACTED*** ({len(value)} chars)' if value else '(empty)'
214-
_print_log(f'{name:<_PAD_MAX}: {masked}', '🔒 ', BOLD_B, wrap_lines=True, level=logging.INFO)
214+
_print_log(f'{name:<{_PAD_MAX}}: {masked}', '🔒 ', BOLD_B, wrap_lines=True, level=logging.INFO)
215215

216216

217217
def print_plain(msg: str = '', *, level: int | None = None, wrap_lines: bool = True, blank_above: bool = False, blank_below: bool = False) -> None:

0 commit comments

Comments
 (0)