summaryrefslogtreecommitdiff
path: root/pyvyos/utils
diff options
context:
space:
mode:
authorRoberto Bertó <463349+robertoberto@users.noreply.github.com>2026-05-19 02:32:04 +0000
committerRoberto Bertó <463349+robertoberto@users.noreply.github.com>2026-05-19 02:32:04 +0000
commit0f76bcc7179976e893b1d9f296b1b1e7988b0031 (patch)
tree87fa89da92263bbe2af7303a0ab36433fdc6f5d3 /pyvyos/utils
parentffd5ba16eb1ada42a582db4ac8bdaf29f66a868f (diff)
downloadpyvyos-0f76bcc7179976e893b1d9f296b1b1e7988b0031.tar.gz
pyvyos-0f76bcc7179976e893b1d9f296b1b1e7988b0031.zip
refactor: remove unused specs, exceptions, and request_id
The pyvyos.specs Pydantic models were never imported by the runtime and had 0% test coverage. The pyvyos.exceptions hierarchy was defined but never raised anywhere. The request_id helper generated UUIDs that were attached to log records but never propagated to callers — half-implemented tracing is worse than none. This commit does not alter request/response logic or HTTP payloads. It only removes code that was never executed and tests for that code. Removed: - pyvyos/specs/ (Pydantic models package) - pyvyos/exceptions.py (SDKError, HttpError, ApiError, ValidationError) - pyvyos/utils/ids.py (request_id helper) - tests/test_exceptions.py - tests/utils/test_ids.py Edited: - pyvyos/core/rest_client.py: drop request_id import and log extras - pyvyos/utils/__init__.py: drop request_id export Tests: 66 -> 57 passing. Coverage: 54% -> 87%. Public API unchanged.
Diffstat (limited to 'pyvyos/utils')
-rw-r--r--pyvyos/utils/__init__.py3
-rw-r--r--pyvyos/utils/ids.py14
2 files changed, 1 insertions, 16 deletions
diff --git a/pyvyos/utils/__init__.py b/pyvyos/utils/__init__.py
index adff044..6290fc1 100644
--- a/pyvyos/utils/__init__.py
+++ b/pyvyos/utils/__init__.py
@@ -1,8 +1,7 @@
"""Utility functions for PyVyOS."""
from .json import redact_key, safe_dumps
-from .ids import request_id
from .paths import build_path
-__all__ = ["redact_key", "safe_dumps", "request_id", "build_path"]
+__all__ = ["redact_key", "safe_dumps", "build_path"]
diff --git a/pyvyos/utils/ids.py b/pyvyos/utils/ids.py
deleted file mode 100644
index 5807ddf..0000000
--- a/pyvyos/utils/ids.py
+++ /dev/null
@@ -1,14 +0,0 @@
-"""ID generation utilities."""
-
-import uuid
-
-
-def request_id() -> str:
- """
- Generate a unique request ID for tracing.
-
- Returns:
- UUID4 string formatted for logging
- """
- return str(uuid.uuid4())
-