query-cache-common 1.5.0__tar.gz → 1.7.0__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.
Files changed (22) hide show
  1. {query_cache_common-1.5.0 → query_cache_common-1.7.0}/PKG-INFO +1 -1
  2. query_cache_common-1.7.0/src/query_cache_common/models/services/execution_service_models.py +121 -0
  3. query_cache_common-1.5.0/src/query_cache_common/models/services/execution_service_models.py +0 -34
  4. {query_cache_common-1.5.0 → query_cache_common-1.7.0}/.gitignore +0 -0
  5. {query_cache_common-1.5.0 → query_cache_common-1.7.0}/pyproject.toml +0 -0
  6. {query_cache_common-1.5.0 → query_cache_common-1.7.0}/src/query_cache_common/__init__.py +0 -0
  7. {query_cache_common-1.5.0 → query_cache_common-1.7.0}/src/query_cache_common/auth.py +0 -0
  8. {query_cache_common-1.5.0 → query_cache_common-1.7.0}/src/query_cache_common/constants.py +0 -0
  9. {query_cache_common-1.5.0 → query_cache_common-1.7.0}/src/query_cache_common/decorators.py +0 -0
  10. {query_cache_common-1.5.0 → query_cache_common-1.7.0}/src/query_cache_common/models/__init__.py +0 -0
  11. {query_cache_common-1.5.0 → query_cache_common-1.7.0}/src/query_cache_common/models/_typing.py +0 -0
  12. {query_cache_common-1.5.0 → query_cache_common-1.7.0}/src/query_cache_common/models/base.py +0 -0
  13. {query_cache_common-1.5.0 → query_cache_common-1.7.0}/src/query_cache_common/models/converters.py +0 -0
  14. {query_cache_common-1.5.0 → query_cache_common-1.7.0}/src/query_cache_common/models/fields.py +0 -0
  15. {query_cache_common-1.5.0 → query_cache_common-1.7.0}/src/query_cache_common/models/services/__init__.py +0 -0
  16. {query_cache_common-1.5.0 → query_cache_common-1.7.0}/src/query_cache_common/models/services/client_telemetry_service_models.py +0 -0
  17. {query_cache_common-1.5.0 → query_cache_common-1.7.0}/src/query_cache_common/models/services/client_validation_service_models.py +0 -0
  18. {query_cache_common-1.5.0 → query_cache_common-1.7.0}/src/query_cache_common/models/services/clone_service_models.py +0 -0
  19. {query_cache_common-1.5.0 → query_cache_common-1.7.0}/src/query_cache_common/models/services/explain_service_models.py +0 -0
  20. {query_cache_common-1.5.0 → query_cache_common-1.7.0}/src/query_cache_common/models/services/sql_service_models.py +0 -0
  21. {query_cache_common-1.5.0 → query_cache_common-1.7.0}/src/query_cache_common/models/shared_models.py +0 -0
  22. {query_cache_common-1.5.0 → query_cache_common-1.7.0}/src/query_cache_common/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: query-cache-common
3
- Version: 1.5.0
3
+ Version: 1.7.0
4
4
  Summary: Common code for Query Cache shared across client and server
5
5
  License: Copyright (c) 2026 Fivetran, Inc.
6
6
 
@@ -0,0 +1,121 @@
1
+ from __future__ import annotations
2
+
3
+ import typing as t
4
+ from dataclasses import field
5
+
6
+ from query_cache_common.decorators import proto_dataclass
7
+ from query_cache_common.models import shared_models
8
+ from query_cache_common.models.services import sql_service_models
9
+ from query_cache_common.models.base import BaseSerDeModel
10
+ from query_cache_common.models.converters import dict_to_struct, struct_to_dict
11
+ from query_cache_protobuf.query_cache.services import execution_service_pb2
12
+
13
+
14
+ @proto_dataclass(execution_service_pb2.ConfirmExecutionRequest)
15
+ class ConfirmExecutionRequest(BaseSerDeModel):
16
+ request_id: str
17
+ last_modified_epoch: t.Optional[int]
18
+ failed_to_clone: bool = False
19
+ table_type: t.Optional[str] = None
20
+ execution_results: t.Dict[str, t.Any] = field(
21
+ default_factory=dict,
22
+ metadata={
23
+ "proto_converter": {
24
+ "from_proto": struct_to_dict,
25
+ "to_proto": dict_to_struct,
26
+ }
27
+ },
28
+ )
29
+ execution_runtime_ms: t.Optional[int] = None
30
+ labels: t.Dict[str, str] = field(default_factory=dict)
31
+
32
+
33
+ @proto_dataclass(execution_service_pb2.ConfirmExecutionResponse)
34
+ class ConfirmExecutionResponse(BaseSerDeModel):
35
+ request_id: str
36
+ success: bool
37
+
38
+
39
+ @proto_dataclass(execution_service_pb2.SQLExecution)
40
+ class SQLExecution(BaseSerDeModel):
41
+ target_table: t.Optional[str]
42
+ dialect: str
43
+ default_catalog: str
44
+ execution_type: shared_models.ModelExecutionType
45
+ sql: str
46
+ tables: t.List[shared_models.TableModifiedInfo] = field(default_factory=list)
47
+ query_dependencies: t.List[shared_models.QueryDependency] = field(default_factory=list)
48
+ semantic_extras: t.Dict[str, str] = field(default_factory=dict)
49
+ labels: t.Dict[str, str] = field(default_factory=dict)
50
+
51
+ @classmethod
52
+ def from_submit_sql_request(
53
+ cls, req: sql_service_models.SubmitEnrichedSQLRequest
54
+ ) -> SQLExecution:
55
+ return cls(
56
+ target_table=req.target_table,
57
+ dialect=req.dialect,
58
+ default_catalog=req.default_catalog,
59
+ execution_type=req.execution_type,
60
+ sql=req.sql,
61
+ tables=req.tables,
62
+ query_dependencies=req.query_dependencies,
63
+ semantic_extras=req.semantic_extras,
64
+ labels=req.labels,
65
+ )
66
+
67
+
68
+ @proto_dataclass(execution_service_pb2.ValuesExecution)
69
+ class ValuesExecution(BaseSerDeModel):
70
+ target_table: str
71
+ dialect: str
72
+ default_catalog: str
73
+ values_hash: str
74
+ semantic_extras: t.Dict[str, str] = field(default_factory=dict)
75
+ labels: t.Dict[str, str] = field(default_factory=dict)
76
+
77
+ @classmethod
78
+ def from_submit_values_request(
79
+ cls, req: sql_service_models.SubmitValuesRequest
80
+ ) -> ValuesExecution:
81
+ return cls(
82
+ target_table=req.target_table,
83
+ dialect=req.dialect,
84
+ default_catalog=req.default_catalog,
85
+ values_hash=req.values_hash,
86
+ semantic_extras=req.semantic_extras,
87
+ labels=req.labels,
88
+ )
89
+
90
+
91
+ @proto_dataclass(execution_service_pb2.ExecutionOutcome)
92
+ class ExecutionOutcome(BaseSerDeModel):
93
+ last_modified_epoch: t.Optional[int]
94
+ table_type: t.Optional[str]
95
+ execution_results: t.Dict[str, t.Any] = field(
96
+ default_factory=dict,
97
+ metadata={
98
+ "proto_converter": {
99
+ "from_proto": struct_to_dict,
100
+ "to_proto": dict_to_struct,
101
+ }
102
+ },
103
+ )
104
+ execution_runtime_ms: t.Optional[int] = None
105
+
106
+
107
+ @proto_dataclass(execution_service_pb2.ExecutionRecord)
108
+ class ExecutionRecord(BaseSerDeModel):
109
+ outcome: ExecutionOutcome
110
+ enriched_sql: t.Optional[SQLExecution] = None
111
+ values: t.Optional[ValuesExecution] = None
112
+
113
+
114
+ @proto_dataclass(execution_service_pb2.RecordExecutionsRequest)
115
+ class RecordExecutionsRequest(BaseSerDeModel):
116
+ records: t.List[ExecutionRecord] = field(default_factory=list)
117
+
118
+
119
+ @proto_dataclass(execution_service_pb2.RecordExecutionsResponse)
120
+ class RecordExecutionsResponse(BaseSerDeModel):
121
+ records_stored: int = 0
@@ -1,34 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import typing as t
4
- from dataclasses import field
5
-
6
- from query_cache_common.decorators import proto_dataclass
7
- from query_cache_common.models.base import BaseSerDeModel
8
- from query_cache_common.models.converters import dict_to_struct, struct_to_dict
9
- from query_cache_protobuf.query_cache.services import execution_service_pb2
10
-
11
-
12
- @proto_dataclass(execution_service_pb2.ConfirmExecutionRequest)
13
- class ConfirmExecutionRequest(BaseSerDeModel):
14
- request_id: str
15
- last_modified_epoch: t.Optional[int]
16
- failed_to_clone: bool = False
17
- table_type: t.Optional[str] = None
18
- execution_results: t.Dict[str, t.Any] = field(
19
- default_factory=dict,
20
- metadata={
21
- "proto_converter": {
22
- "from_proto": struct_to_dict,
23
- "to_proto": dict_to_struct,
24
- }
25
- },
26
- )
27
- execution_runtime_ms: t.Optional[int] = None
28
- labels: t.Dict[str, str] = field(default_factory=dict)
29
-
30
-
31
- @proto_dataclass(execution_service_pb2.ConfirmExecutionResponse)
32
- class ConfirmExecutionResponse(BaseSerDeModel):
33
- request_id: str
34
- success: bool