query-cache-common 1.9.1__tar.gz → 1.9.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/PKG-INFO +1 -1
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/utils.py +19 -0
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/.gitignore +0 -0
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/pyproject.toml +0 -0
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/__init__.py +0 -0
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/auth.py +0 -0
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/constants.py +0 -0
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/decorators.py +0 -0
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/models/__init__.py +0 -0
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/models/_typing.py +0 -0
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/models/base.py +0 -0
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/models/converters.py +0 -0
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/models/fields.py +0 -0
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/models/services/__init__.py +0 -0
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/models/services/client_telemetry_service_models.py +0 -0
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/models/services/client_validation_service_models.py +0 -0
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/models/services/clone_service_models.py +0 -0
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/models/services/execution_service_models.py +0 -0
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/models/services/explain_service_models.py +0 -0
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/models/services/sql_service_models.py +0 -0
- {query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/models/shared_models.py +0 -0
|
@@ -26,6 +26,25 @@ def str_to_bool(s: str | None) -> bool:
|
|
|
26
26
|
return s.lower() in ("true", "1", "t", "y", "yes", "on")
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
def to_bool(value: t.Any) -> bool:
|
|
30
|
+
"""Coerce a bool, int, or string to a boolean.
|
|
31
|
+
|
|
32
|
+
Unlike str_to_bool, this accepts bools and ints directly (strings are delegated to
|
|
33
|
+
str_to_bool) and raises ValueError for any other type rather than silently
|
|
34
|
+
returning False.
|
|
35
|
+
"""
|
|
36
|
+
if isinstance(value, bool):
|
|
37
|
+
return value
|
|
38
|
+
if isinstance(value, str):
|
|
39
|
+
return str_to_bool(value)
|
|
40
|
+
if isinstance(value, int):
|
|
41
|
+
return bool(value)
|
|
42
|
+
raise ValueError(
|
|
43
|
+
f"Cannot convert value of type {type(value).__name__} to bool: {value!r}. "
|
|
44
|
+
"Expected bool, int, or string (e.g., 'true', 'false', 'yes', 'no')."
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
29
48
|
def current_epoch_millis() -> int:
|
|
30
49
|
"""Return the current time in milliseconds since Unix epoch."""
|
|
31
50
|
return time.time_ns() // 1_000_000
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/models/__init__.py
RENAMED
|
File without changes
|
{query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/models/_typing.py
RENAMED
|
File without changes
|
|
File without changes
|
{query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/models/converters.py
RENAMED
|
File without changes
|
{query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/models/fields.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{query_cache_common-1.9.1 → query_cache_common-1.9.2}/src/query_cache_common/models/shared_models.py
RENAMED
|
File without changes
|