query-cache-common 1.2.0__tar.gz → 1.2.1__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.2.0 → query_cache_common-1.2.1}/.gitignore +3 -0
- {query_cache_common-1.2.0 → query_cache_common-1.2.1}/PKG-INFO +2 -1
- {query_cache_common-1.2.0 → query_cache_common-1.2.1}/pyproject.toml +1 -0
- {query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/models/services/explain_service_models.py +4 -0
- {query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/utils.py +15 -0
- {query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/__init__.py +0 -0
- {query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/auth.py +0 -0
- {query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/constants.py +0 -0
- {query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/decorators.py +0 -0
- {query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/models/__init__.py +0 -0
- {query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/models/_typing.py +0 -0
- {query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/models/base.py +0 -0
- {query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/models/converters.py +0 -0
- {query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/models/fields.py +0 -0
- {query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/models/services/__init__.py +0 -0
- {query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/models/services/client_telemetry_service_models.py +0 -0
- {query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/models/services/client_validation_service_models.py +0 -0
- {query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/models/services/clone_service_models.py +0 -0
- {query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/models/services/execution_service_models.py +0 -0
- {query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/models/services/sql_service_models.py +0 -0
- {query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/models/shared_models.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: query-cache-common
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: Common code for Query Cache shared across client and server
|
|
5
5
|
License: Copyright (c) 2026 Fivetran, Inc.
|
|
6
6
|
|
|
@@ -32,5 +32,6 @@ License: Copyright (c) 2026 Fivetran, Inc.
|
|
|
32
32
|
FROM USE OF THIS SOFTWARE, INCLUDING DIRECT, INDIRECT, INCIDENTAL,
|
|
33
33
|
PUNITIVE, AND CONSEQUENTIAL DAMAGES.
|
|
34
34
|
Requires-Python: >=3.9
|
|
35
|
+
Requires-Dist: humanize
|
|
35
36
|
Requires-Dist: query-cache-protobuf
|
|
36
37
|
Requires-Dist: typing-extensions>=4.0.0
|
|
@@ -57,3 +57,7 @@ class GetExplainMessagesRequest(BaseSerDeModel):
|
|
|
57
57
|
@proto_dataclass(explain_service_pb2.GetExplainMessagesResponse)
|
|
58
58
|
class GetExplainMessagesResponse(BaseSerDeModel):
|
|
59
59
|
messages: t.List[ExplainMessageEntry]
|
|
60
|
+
|
|
61
|
+
@property
|
|
62
|
+
def by_id(self) -> t.Dict[str, ExplainMessageEntry]:
|
|
63
|
+
return {m.execution_decision_id: m for m in self.messages}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import datetime
|
|
4
|
+
import humanize
|
|
3
5
|
import time
|
|
4
6
|
import typing as t
|
|
5
7
|
|
|
@@ -114,3 +116,16 @@ def extract_fqn_parts(fqn: str, dialect: str) -> t.Tuple[str, str, str]:
|
|
|
114
116
|
raise ValueError(f"Expecting SQLGlot expression for name, got: {name}")
|
|
115
117
|
|
|
116
118
|
return catalog.sql(dialect=dialect), schema.sql(dialect=dialect), name.sql(dialect=dialect)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def format_as_localtime(dt: datetime.datetime) -> str:
|
|
122
|
+
local_dt = dt.astimezone() # convert to localtime
|
|
123
|
+
return local_dt.strftime("%Y-%m-%d %H:%M:%S %Z")
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def format_epoch_relative(epoch: t.Optional[int]) -> str:
|
|
127
|
+
if epoch is None:
|
|
128
|
+
return "no data"
|
|
129
|
+
|
|
130
|
+
as_dt = datetime.datetime.fromtimestamp(epoch / 1000, tz=datetime.timezone.utc)
|
|
131
|
+
return f"{humanize.naturaltime(as_dt)}, {format_as_localtime(as_dt)}"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/models/__init__.py
RENAMED
|
File without changes
|
{query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/models/_typing.py
RENAMED
|
File without changes
|
|
File without changes
|
{query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/models/converters.py
RENAMED
|
File without changes
|
{query_cache_common-1.2.0 → query_cache_common-1.2.1}/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
|
{query_cache_common-1.2.0 → query_cache_common-1.2.1}/src/query_cache_common/models/shared_models.py
RENAMED
|
File without changes
|