qwak-core 0.4.245__py3-none-any.whl → 0.4.247__py3-none-any.whl
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.
- _qwak_proto/qwak/service_discovery/service_discovery_location_pb2.py +65 -0
- _qwak_proto/qwak/service_discovery/service_discovery_location_pb2.pyi +73 -0
- _qwak_proto/qwak/service_discovery/service_discovery_location_pb2_grpc.py +4 -0
- _qwak_proto/qwak/service_discovery/service_discovery_location_service_pb2.py +49 -0
- _qwak_proto/qwak/service_discovery/service_discovery_location_service_pb2.pyi +41 -0
- _qwak_proto/qwak/service_discovery/service_discovery_location_service_pb2_grpc.py +231 -0
- qwak/__init__.py +1 -1
- qwak/clients/feature_store/offline_serving_client.py +29 -4
- qwak/clients/location_discovery/__init__.py +1 -0
- qwak/clients/location_discovery/client.py +73 -0
- qwak/feature_store/_common/functions.py +0 -19
- qwak/feature_store/offline/__init__.py +1 -2
- qwak/inner/build_logic/phases/phase_020_remote_register_qwak_build/upload_step.py +20 -20
- {qwak_core-0.4.245.dist-info → qwak_core-0.4.247.dist-info}/METADATA +1 -1
- {qwak_core-0.4.245.dist-info → qwak_core-0.4.247.dist-info}/RECORD +19 -15
- qwak_services_mock/mocks/location_discovery_service_api.py +104 -0
- qwak_services_mock/mocks/qwak_mocks.py +4 -0
- qwak_services_mock/services_mock.py +13 -0
- qwak/feature_store/_common/featureset_asterisk_handler.py +0 -115
- qwak/feature_store/offline/_query_engine.py +0 -32
- qwak/feature_store/offline/athena/__init__.py +0 -0
- qwak/feature_store/offline/athena/athena_query_engine.py +0 -153
- qwak/feature_store/offline/client.py +0 -718
- {qwak_core-0.4.245.dist-info → qwak_core-0.4.247.dist-info}/WHEEL +0 -0
@@ -0,0 +1,65 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: qwak/service_discovery/service_discovery_location.proto
|
4
|
+
"""Generated protocol buffer code."""
|
5
|
+
from google.protobuf import descriptor as _descriptor
|
6
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
7
|
+
from google.protobuf import message as _message
|
8
|
+
from google.protobuf import reflection as _reflection
|
9
|
+
from google.protobuf import symbol_database as _symbol_database
|
10
|
+
# @@protoc_insertion_point(imports)
|
11
|
+
|
12
|
+
_sym_db = _symbol_database.Default()
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n7qwak/service_discovery/service_discovery_location.proto\x12\"qwak.service_discovery.location.v0\"w\n\x19ServiceLocationDescriptor\x12\x13\n\x0bservice_url\x18\x01 \x01(\t\x12\x45\n\x08location\x18\x02 \x01(\x0b\x32\x33.qwak.service_discovery.location.v0.ServiceLocation\"\x99\x01\n\x0fServiceLocation\x12\x38\n\x04\x63ore\x18\x01 \x01(\x0b\x32(.qwak.service_discovery.location.v0.CoreH\x00\x12\x38\n\x04\x65\x64ge\x18\x02 \x01(\x0b\x32(.qwak.service_discovery.location.v0.EdgeH\x00\x42\x12\n\x10service_location\"\x06\n\x04\x43ore\"\x06\n\x04\x45\x64geB-\n)com.qwak.ai.service_discovery.location.v0P\x01\x62\x06proto3')
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
_SERVICELOCATIONDESCRIPTOR = DESCRIPTOR.message_types_by_name['ServiceLocationDescriptor']
|
22
|
+
_SERVICELOCATION = DESCRIPTOR.message_types_by_name['ServiceLocation']
|
23
|
+
_CORE = DESCRIPTOR.message_types_by_name['Core']
|
24
|
+
_EDGE = DESCRIPTOR.message_types_by_name['Edge']
|
25
|
+
ServiceLocationDescriptor = _reflection.GeneratedProtocolMessageType('ServiceLocationDescriptor', (_message.Message,), {
|
26
|
+
'DESCRIPTOR' : _SERVICELOCATIONDESCRIPTOR,
|
27
|
+
'__module__' : 'qwak.service_discovery.service_discovery_location_pb2'
|
28
|
+
# @@protoc_insertion_point(class_scope:qwak.service_discovery.location.v0.ServiceLocationDescriptor)
|
29
|
+
})
|
30
|
+
_sym_db.RegisterMessage(ServiceLocationDescriptor)
|
31
|
+
|
32
|
+
ServiceLocation = _reflection.GeneratedProtocolMessageType('ServiceLocation', (_message.Message,), {
|
33
|
+
'DESCRIPTOR' : _SERVICELOCATION,
|
34
|
+
'__module__' : 'qwak.service_discovery.service_discovery_location_pb2'
|
35
|
+
# @@protoc_insertion_point(class_scope:qwak.service_discovery.location.v0.ServiceLocation)
|
36
|
+
})
|
37
|
+
_sym_db.RegisterMessage(ServiceLocation)
|
38
|
+
|
39
|
+
Core = _reflection.GeneratedProtocolMessageType('Core', (_message.Message,), {
|
40
|
+
'DESCRIPTOR' : _CORE,
|
41
|
+
'__module__' : 'qwak.service_discovery.service_discovery_location_pb2'
|
42
|
+
# @@protoc_insertion_point(class_scope:qwak.service_discovery.location.v0.Core)
|
43
|
+
})
|
44
|
+
_sym_db.RegisterMessage(Core)
|
45
|
+
|
46
|
+
Edge = _reflection.GeneratedProtocolMessageType('Edge', (_message.Message,), {
|
47
|
+
'DESCRIPTOR' : _EDGE,
|
48
|
+
'__module__' : 'qwak.service_discovery.service_discovery_location_pb2'
|
49
|
+
# @@protoc_insertion_point(class_scope:qwak.service_discovery.location.v0.Edge)
|
50
|
+
})
|
51
|
+
_sym_db.RegisterMessage(Edge)
|
52
|
+
|
53
|
+
if _descriptor._USE_C_DESCRIPTORS == False:
|
54
|
+
|
55
|
+
DESCRIPTOR._options = None
|
56
|
+
DESCRIPTOR._serialized_options = b'\n)com.qwak.ai.service_discovery.location.v0P\001'
|
57
|
+
_SERVICELOCATIONDESCRIPTOR._serialized_start=95
|
58
|
+
_SERVICELOCATIONDESCRIPTOR._serialized_end=214
|
59
|
+
_SERVICELOCATION._serialized_start=217
|
60
|
+
_SERVICELOCATION._serialized_end=370
|
61
|
+
_CORE._serialized_start=372
|
62
|
+
_CORE._serialized_end=378
|
63
|
+
_EDGE._serialized_start=380
|
64
|
+
_EDGE._serialized_end=386
|
65
|
+
# @@protoc_insertion_point(module_scope)
|
@@ -0,0 +1,73 @@
|
|
1
|
+
"""
|
2
|
+
@generated by mypy-protobuf. Do not edit manually!
|
3
|
+
isort:skip_file
|
4
|
+
"""
|
5
|
+
import builtins
|
6
|
+
import google.protobuf.descriptor
|
7
|
+
import google.protobuf.message
|
8
|
+
import sys
|
9
|
+
|
10
|
+
if sys.version_info >= (3, 8):
|
11
|
+
import typing as typing_extensions
|
12
|
+
else:
|
13
|
+
import typing_extensions
|
14
|
+
|
15
|
+
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
16
|
+
|
17
|
+
class ServiceLocationDescriptor(google.protobuf.message.Message):
|
18
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
19
|
+
|
20
|
+
SERVICE_URL_FIELD_NUMBER: builtins.int
|
21
|
+
LOCATION_FIELD_NUMBER: builtins.int
|
22
|
+
service_url: builtins.str
|
23
|
+
@property
|
24
|
+
def location(self) -> global___ServiceLocation: ...
|
25
|
+
def __init__(
|
26
|
+
self,
|
27
|
+
*,
|
28
|
+
service_url: builtins.str = ...,
|
29
|
+
location: global___ServiceLocation | None = ...,
|
30
|
+
) -> None: ...
|
31
|
+
def HasField(self, field_name: typing_extensions.Literal["location", b"location"]) -> builtins.bool: ...
|
32
|
+
def ClearField(self, field_name: typing_extensions.Literal["location", b"location", "service_url", b"service_url"]) -> None: ...
|
33
|
+
|
34
|
+
global___ServiceLocationDescriptor = ServiceLocationDescriptor
|
35
|
+
|
36
|
+
class ServiceLocation(google.protobuf.message.Message):
|
37
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
38
|
+
|
39
|
+
CORE_FIELD_NUMBER: builtins.int
|
40
|
+
EDGE_FIELD_NUMBER: builtins.int
|
41
|
+
@property
|
42
|
+
def core(self) -> global___Core: ...
|
43
|
+
@property
|
44
|
+
def edge(self) -> global___Edge: ...
|
45
|
+
def __init__(
|
46
|
+
self,
|
47
|
+
*,
|
48
|
+
core: global___Core | None = ...,
|
49
|
+
edge: global___Edge | None = ...,
|
50
|
+
) -> None: ...
|
51
|
+
def HasField(self, field_name: typing_extensions.Literal["core", b"core", "edge", b"edge", "service_location", b"service_location"]) -> builtins.bool: ...
|
52
|
+
def ClearField(self, field_name: typing_extensions.Literal["core", b"core", "edge", b"edge", "service_location", b"service_location"]) -> None: ...
|
53
|
+
def WhichOneof(self, oneof_group: typing_extensions.Literal["service_location", b"service_location"]) -> typing_extensions.Literal["core", "edge"] | None: ...
|
54
|
+
|
55
|
+
global___ServiceLocation = ServiceLocation
|
56
|
+
|
57
|
+
class Core(google.protobuf.message.Message):
|
58
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
59
|
+
|
60
|
+
def __init__(
|
61
|
+
self,
|
62
|
+
) -> None: ...
|
63
|
+
|
64
|
+
global___Core = Core
|
65
|
+
|
66
|
+
class Edge(google.protobuf.message.Message):
|
67
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
68
|
+
|
69
|
+
def __init__(
|
70
|
+
self,
|
71
|
+
) -> None: ...
|
72
|
+
|
73
|
+
global___Edge = Edge
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: qwak/service_discovery/service_discovery_location_service.proto
|
4
|
+
"""Generated protocol buffer code."""
|
5
|
+
from google.protobuf import descriptor as _descriptor
|
6
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
7
|
+
from google.protobuf import message as _message
|
8
|
+
from google.protobuf import reflection as _reflection
|
9
|
+
from google.protobuf import symbol_database as _symbol_database
|
10
|
+
# @@protoc_insertion_point(imports)
|
11
|
+
|
12
|
+
_sym_db = _symbol_database.Default()
|
13
|
+
|
14
|
+
|
15
|
+
from _qwak_proto.qwak.service_discovery import service_discovery_location_pb2 as qwak_dot_service__discovery_dot_service__discovery__location__pb2
|
16
|
+
|
17
|
+
|
18
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n?qwak/service_discovery/service_discovery_location_service.proto\x12\"qwak.service_discovery.location.v0\x1a\x37qwak/service_discovery/service_discovery_location.proto\"\x16\n\x14GetServingUrlRequest\"o\n\x1cGetServingUrlRequestResponse\x12O\n\x08location\x18\x01 \x01(\x0b\x32=.qwak.service_discovery.location.v0.ServiceLocationDescriptor2\xa0\x07\n\x18LocationDiscoveryService\x12\x92\x01\n\x14GetOfflineServingUrl\x12\x38.qwak.service_discovery.location.v0.GetServingUrlRequest\x1a@.qwak.service_discovery.location.v0.GetServingUrlRequestResponse\x12\x97\x01\n\x19GetDistributionManagerUrl\x12\x38.qwak.service_discovery.location.v0.GetServingUrlRequest\x1a@.qwak.service_discovery.location.v0.GetServingUrlRequestResponse\x12\x93\x01\n\x15GetAnalyticsEngineUrl\x12\x38.qwak.service_discovery.location.v0.GetServingUrlRequest\x1a@.qwak.service_discovery.location.v0.GetServingUrlRequestResponse\x12\x92\x01\n\x14GetMetricsGatewayUrl\x12\x38.qwak.service_discovery.location.v0.GetServingUrlRequest\x1a@.qwak.service_discovery.location.v0.GetServingUrlRequestResponse\x12\x94\x01\n\x16GetFeaturesOperatorUrl\x12\x38.qwak.service_discovery.location.v0.GetServingUrlRequest\x1a@.qwak.service_discovery.location.v0.GetServingUrlRequestResponse\x12\x92\x01\n\x14GetHostingGatewayUrl\x12\x38.qwak.service_discovery.location.v0.GetServingUrlRequest\x1a@.qwak.service_discovery.location.v0.GetServingUrlRequestResponseB-\n)com.qwak.ai.service_discovery.location.v0P\x01\x62\x06proto3')
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
_GETSERVINGURLREQUEST = DESCRIPTOR.message_types_by_name['GetServingUrlRequest']
|
23
|
+
_GETSERVINGURLREQUESTRESPONSE = DESCRIPTOR.message_types_by_name['GetServingUrlRequestResponse']
|
24
|
+
GetServingUrlRequest = _reflection.GeneratedProtocolMessageType('GetServingUrlRequest', (_message.Message,), {
|
25
|
+
'DESCRIPTOR' : _GETSERVINGURLREQUEST,
|
26
|
+
'__module__' : 'qwak.service_discovery.service_discovery_location_service_pb2'
|
27
|
+
# @@protoc_insertion_point(class_scope:qwak.service_discovery.location.v0.GetServingUrlRequest)
|
28
|
+
})
|
29
|
+
_sym_db.RegisterMessage(GetServingUrlRequest)
|
30
|
+
|
31
|
+
GetServingUrlRequestResponse = _reflection.GeneratedProtocolMessageType('GetServingUrlRequestResponse', (_message.Message,), {
|
32
|
+
'DESCRIPTOR' : _GETSERVINGURLREQUESTRESPONSE,
|
33
|
+
'__module__' : 'qwak.service_discovery.service_discovery_location_service_pb2'
|
34
|
+
# @@protoc_insertion_point(class_scope:qwak.service_discovery.location.v0.GetServingUrlRequestResponse)
|
35
|
+
})
|
36
|
+
_sym_db.RegisterMessage(GetServingUrlRequestResponse)
|
37
|
+
|
38
|
+
_LOCATIONDISCOVERYSERVICE = DESCRIPTOR.services_by_name['LocationDiscoveryService']
|
39
|
+
if _descriptor._USE_C_DESCRIPTORS == False:
|
40
|
+
|
41
|
+
DESCRIPTOR._options = None
|
42
|
+
DESCRIPTOR._serialized_options = b'\n)com.qwak.ai.service_discovery.location.v0P\001'
|
43
|
+
_GETSERVINGURLREQUEST._serialized_start=160
|
44
|
+
_GETSERVINGURLREQUEST._serialized_end=182
|
45
|
+
_GETSERVINGURLREQUESTRESPONSE._serialized_start=184
|
46
|
+
_GETSERVINGURLREQUESTRESPONSE._serialized_end=295
|
47
|
+
_LOCATIONDISCOVERYSERVICE._serialized_start=298
|
48
|
+
_LOCATIONDISCOVERYSERVICE._serialized_end=1226
|
49
|
+
# @@protoc_insertion_point(module_scope)
|
@@ -0,0 +1,41 @@
|
|
1
|
+
"""
|
2
|
+
@generated by mypy-protobuf. Do not edit manually!
|
3
|
+
isort:skip_file
|
4
|
+
"""
|
5
|
+
import builtins
|
6
|
+
import google.protobuf.descriptor
|
7
|
+
import google.protobuf.message
|
8
|
+
import qwak.service_discovery.service_discovery_location_pb2
|
9
|
+
import sys
|
10
|
+
|
11
|
+
if sys.version_info >= (3, 8):
|
12
|
+
import typing as typing_extensions
|
13
|
+
else:
|
14
|
+
import typing_extensions
|
15
|
+
|
16
|
+
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
17
|
+
|
18
|
+
class GetServingUrlRequest(google.protobuf.message.Message):
|
19
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
20
|
+
|
21
|
+
def __init__(
|
22
|
+
self,
|
23
|
+
) -> None: ...
|
24
|
+
|
25
|
+
global___GetServingUrlRequest = GetServingUrlRequest
|
26
|
+
|
27
|
+
class GetServingUrlRequestResponse(google.protobuf.message.Message):
|
28
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
29
|
+
|
30
|
+
LOCATION_FIELD_NUMBER: builtins.int
|
31
|
+
@property
|
32
|
+
def location(self) -> qwak.service_discovery.service_discovery_location_pb2.ServiceLocationDescriptor: ...
|
33
|
+
def __init__(
|
34
|
+
self,
|
35
|
+
*,
|
36
|
+
location: qwak.service_discovery.service_discovery_location_pb2.ServiceLocationDescriptor | None = ...,
|
37
|
+
) -> None: ...
|
38
|
+
def HasField(self, field_name: typing_extensions.Literal["location", b"location"]) -> builtins.bool: ...
|
39
|
+
def ClearField(self, field_name: typing_extensions.Literal["location", b"location"]) -> None: ...
|
40
|
+
|
41
|
+
global___GetServingUrlRequestResponse = GetServingUrlRequestResponse
|
@@ -0,0 +1,231 @@
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
3
|
+
import grpc
|
4
|
+
|
5
|
+
from _qwak_proto.qwak.service_discovery import service_discovery_location_service_pb2 as qwak_dot_service__discovery_dot_service__discovery__location__service__pb2
|
6
|
+
|
7
|
+
|
8
|
+
class LocationDiscoveryServiceStub(object):
|
9
|
+
"""Missing associated documentation comment in .proto file."""
|
10
|
+
|
11
|
+
def __init__(self, channel):
|
12
|
+
"""Constructor.
|
13
|
+
|
14
|
+
Args:
|
15
|
+
channel: A grpc.Channel.
|
16
|
+
"""
|
17
|
+
self.GetOfflineServingUrl = channel.unary_unary(
|
18
|
+
'/qwak.service_discovery.location.v0.LocationDiscoveryService/GetOfflineServingUrl',
|
19
|
+
request_serializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequest.SerializeToString,
|
20
|
+
response_deserializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequestResponse.FromString,
|
21
|
+
)
|
22
|
+
self.GetDistributionManagerUrl = channel.unary_unary(
|
23
|
+
'/qwak.service_discovery.location.v0.LocationDiscoveryService/GetDistributionManagerUrl',
|
24
|
+
request_serializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequest.SerializeToString,
|
25
|
+
response_deserializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequestResponse.FromString,
|
26
|
+
)
|
27
|
+
self.GetAnalyticsEngineUrl = channel.unary_unary(
|
28
|
+
'/qwak.service_discovery.location.v0.LocationDiscoveryService/GetAnalyticsEngineUrl',
|
29
|
+
request_serializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequest.SerializeToString,
|
30
|
+
response_deserializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequestResponse.FromString,
|
31
|
+
)
|
32
|
+
self.GetMetricsGatewayUrl = channel.unary_unary(
|
33
|
+
'/qwak.service_discovery.location.v0.LocationDiscoveryService/GetMetricsGatewayUrl',
|
34
|
+
request_serializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequest.SerializeToString,
|
35
|
+
response_deserializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequestResponse.FromString,
|
36
|
+
)
|
37
|
+
self.GetFeaturesOperatorUrl = channel.unary_unary(
|
38
|
+
'/qwak.service_discovery.location.v0.LocationDiscoveryService/GetFeaturesOperatorUrl',
|
39
|
+
request_serializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequest.SerializeToString,
|
40
|
+
response_deserializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequestResponse.FromString,
|
41
|
+
)
|
42
|
+
self.GetHostingGatewayUrl = channel.unary_unary(
|
43
|
+
'/qwak.service_discovery.location.v0.LocationDiscoveryService/GetHostingGatewayUrl',
|
44
|
+
request_serializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequest.SerializeToString,
|
45
|
+
response_deserializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequestResponse.FromString,
|
46
|
+
)
|
47
|
+
|
48
|
+
|
49
|
+
class LocationDiscoveryServiceServicer(object):
|
50
|
+
"""Missing associated documentation comment in .proto file."""
|
51
|
+
|
52
|
+
def GetOfflineServingUrl(self, request, context):
|
53
|
+
"""Missing associated documentation comment in .proto file."""
|
54
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
55
|
+
context.set_details('Method not implemented!')
|
56
|
+
raise NotImplementedError('Method not implemented!')
|
57
|
+
|
58
|
+
def GetDistributionManagerUrl(self, request, context):
|
59
|
+
"""Missing associated documentation comment in .proto file."""
|
60
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
61
|
+
context.set_details('Method not implemented!')
|
62
|
+
raise NotImplementedError('Method not implemented!')
|
63
|
+
|
64
|
+
def GetAnalyticsEngineUrl(self, request, context):
|
65
|
+
"""Missing associated documentation comment in .proto file."""
|
66
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
67
|
+
context.set_details('Method not implemented!')
|
68
|
+
raise NotImplementedError('Method not implemented!')
|
69
|
+
|
70
|
+
def GetMetricsGatewayUrl(self, request, context):
|
71
|
+
"""Missing associated documentation comment in .proto file."""
|
72
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
73
|
+
context.set_details('Method not implemented!')
|
74
|
+
raise NotImplementedError('Method not implemented!')
|
75
|
+
|
76
|
+
def GetFeaturesOperatorUrl(self, request, context):
|
77
|
+
"""Missing associated documentation comment in .proto file."""
|
78
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
79
|
+
context.set_details('Method not implemented!')
|
80
|
+
raise NotImplementedError('Method not implemented!')
|
81
|
+
|
82
|
+
def GetHostingGatewayUrl(self, request, context):
|
83
|
+
"""Missing associated documentation comment in .proto file."""
|
84
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
85
|
+
context.set_details('Method not implemented!')
|
86
|
+
raise NotImplementedError('Method not implemented!')
|
87
|
+
|
88
|
+
|
89
|
+
def add_LocationDiscoveryServiceServicer_to_server(servicer, server):
|
90
|
+
rpc_method_handlers = {
|
91
|
+
'GetOfflineServingUrl': grpc.unary_unary_rpc_method_handler(
|
92
|
+
servicer.GetOfflineServingUrl,
|
93
|
+
request_deserializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequest.FromString,
|
94
|
+
response_serializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequestResponse.SerializeToString,
|
95
|
+
),
|
96
|
+
'GetDistributionManagerUrl': grpc.unary_unary_rpc_method_handler(
|
97
|
+
servicer.GetDistributionManagerUrl,
|
98
|
+
request_deserializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequest.FromString,
|
99
|
+
response_serializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequestResponse.SerializeToString,
|
100
|
+
),
|
101
|
+
'GetAnalyticsEngineUrl': grpc.unary_unary_rpc_method_handler(
|
102
|
+
servicer.GetAnalyticsEngineUrl,
|
103
|
+
request_deserializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequest.FromString,
|
104
|
+
response_serializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequestResponse.SerializeToString,
|
105
|
+
),
|
106
|
+
'GetMetricsGatewayUrl': grpc.unary_unary_rpc_method_handler(
|
107
|
+
servicer.GetMetricsGatewayUrl,
|
108
|
+
request_deserializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequest.FromString,
|
109
|
+
response_serializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequestResponse.SerializeToString,
|
110
|
+
),
|
111
|
+
'GetFeaturesOperatorUrl': grpc.unary_unary_rpc_method_handler(
|
112
|
+
servicer.GetFeaturesOperatorUrl,
|
113
|
+
request_deserializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequest.FromString,
|
114
|
+
response_serializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequestResponse.SerializeToString,
|
115
|
+
),
|
116
|
+
'GetHostingGatewayUrl': grpc.unary_unary_rpc_method_handler(
|
117
|
+
servicer.GetHostingGatewayUrl,
|
118
|
+
request_deserializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequest.FromString,
|
119
|
+
response_serializer=qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequestResponse.SerializeToString,
|
120
|
+
),
|
121
|
+
}
|
122
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
123
|
+
'qwak.service_discovery.location.v0.LocationDiscoveryService', rpc_method_handlers)
|
124
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
125
|
+
|
126
|
+
|
127
|
+
# This class is part of an EXPERIMENTAL API.
|
128
|
+
class LocationDiscoveryService(object):
|
129
|
+
"""Missing associated documentation comment in .proto file."""
|
130
|
+
|
131
|
+
@staticmethod
|
132
|
+
def GetOfflineServingUrl(request,
|
133
|
+
target,
|
134
|
+
options=(),
|
135
|
+
channel_credentials=None,
|
136
|
+
call_credentials=None,
|
137
|
+
insecure=False,
|
138
|
+
compression=None,
|
139
|
+
wait_for_ready=None,
|
140
|
+
timeout=None,
|
141
|
+
metadata=None):
|
142
|
+
return grpc.experimental.unary_unary(request, target, '/qwak.service_discovery.location.v0.LocationDiscoveryService/GetOfflineServingUrl',
|
143
|
+
qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequest.SerializeToString,
|
144
|
+
qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequestResponse.FromString,
|
145
|
+
options, channel_credentials,
|
146
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
147
|
+
|
148
|
+
@staticmethod
|
149
|
+
def GetDistributionManagerUrl(request,
|
150
|
+
target,
|
151
|
+
options=(),
|
152
|
+
channel_credentials=None,
|
153
|
+
call_credentials=None,
|
154
|
+
insecure=False,
|
155
|
+
compression=None,
|
156
|
+
wait_for_ready=None,
|
157
|
+
timeout=None,
|
158
|
+
metadata=None):
|
159
|
+
return grpc.experimental.unary_unary(request, target, '/qwak.service_discovery.location.v0.LocationDiscoveryService/GetDistributionManagerUrl',
|
160
|
+
qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequest.SerializeToString,
|
161
|
+
qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequestResponse.FromString,
|
162
|
+
options, channel_credentials,
|
163
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
164
|
+
|
165
|
+
@staticmethod
|
166
|
+
def GetAnalyticsEngineUrl(request,
|
167
|
+
target,
|
168
|
+
options=(),
|
169
|
+
channel_credentials=None,
|
170
|
+
call_credentials=None,
|
171
|
+
insecure=False,
|
172
|
+
compression=None,
|
173
|
+
wait_for_ready=None,
|
174
|
+
timeout=None,
|
175
|
+
metadata=None):
|
176
|
+
return grpc.experimental.unary_unary(request, target, '/qwak.service_discovery.location.v0.LocationDiscoveryService/GetAnalyticsEngineUrl',
|
177
|
+
qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequest.SerializeToString,
|
178
|
+
qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequestResponse.FromString,
|
179
|
+
options, channel_credentials,
|
180
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
181
|
+
|
182
|
+
@staticmethod
|
183
|
+
def GetMetricsGatewayUrl(request,
|
184
|
+
target,
|
185
|
+
options=(),
|
186
|
+
channel_credentials=None,
|
187
|
+
call_credentials=None,
|
188
|
+
insecure=False,
|
189
|
+
compression=None,
|
190
|
+
wait_for_ready=None,
|
191
|
+
timeout=None,
|
192
|
+
metadata=None):
|
193
|
+
return grpc.experimental.unary_unary(request, target, '/qwak.service_discovery.location.v0.LocationDiscoveryService/GetMetricsGatewayUrl',
|
194
|
+
qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequest.SerializeToString,
|
195
|
+
qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequestResponse.FromString,
|
196
|
+
options, channel_credentials,
|
197
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
198
|
+
|
199
|
+
@staticmethod
|
200
|
+
def GetFeaturesOperatorUrl(request,
|
201
|
+
target,
|
202
|
+
options=(),
|
203
|
+
channel_credentials=None,
|
204
|
+
call_credentials=None,
|
205
|
+
insecure=False,
|
206
|
+
compression=None,
|
207
|
+
wait_for_ready=None,
|
208
|
+
timeout=None,
|
209
|
+
metadata=None):
|
210
|
+
return grpc.experimental.unary_unary(request, target, '/qwak.service_discovery.location.v0.LocationDiscoveryService/GetFeaturesOperatorUrl',
|
211
|
+
qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequest.SerializeToString,
|
212
|
+
qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequestResponse.FromString,
|
213
|
+
options, channel_credentials,
|
214
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
215
|
+
|
216
|
+
@staticmethod
|
217
|
+
def GetHostingGatewayUrl(request,
|
218
|
+
target,
|
219
|
+
options=(),
|
220
|
+
channel_credentials=None,
|
221
|
+
call_credentials=None,
|
222
|
+
insecure=False,
|
223
|
+
compression=None,
|
224
|
+
wait_for_ready=None,
|
225
|
+
timeout=None,
|
226
|
+
metadata=None):
|
227
|
+
return grpc.experimental.unary_unary(request, target, '/qwak.service_discovery.location.v0.LocationDiscoveryService/GetHostingGatewayUrl',
|
228
|
+
qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequest.SerializeToString,
|
229
|
+
qwak_dot_service__discovery_dot_service__discovery__location__service__pb2.GetServingUrlRequestResponse.FromString,
|
230
|
+
options, channel_credentials,
|
231
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
qwak/__init__.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import logging
|
2
2
|
from typing import List, Optional
|
3
3
|
|
4
|
+
import grpc
|
4
5
|
from _qwak_proto.qwak.offline.serving.v1.feature_values_pb2 import (
|
5
6
|
FeaturesetFeatures as ProtoFeaturesetFeatures,
|
6
7
|
)
|
@@ -27,9 +28,9 @@ from _qwak_proto.qwak.offline.serving.v1.population_pb2 import (
|
|
27
28
|
PopulationFileUploadUrlType as ProtoPopulationFileUploadUrlType,
|
28
29
|
TimedPopulation as ProtoTimedPopulation,
|
29
30
|
)
|
30
|
-
from dependency_injector.wiring import Provide
|
31
31
|
from google.protobuf.timestamp_pb2 import Timestamp as ProtoTimestamp
|
32
|
-
from qwak.
|
32
|
+
from qwak.clients.location_discovery import LocationDiscoveryClient
|
33
|
+
from qwak.inner.tool.grpc.grpc_tools import create_grpc_channel
|
33
34
|
from qwak.inner.tool.retry_utils import retry
|
34
35
|
|
35
36
|
|
@@ -46,8 +47,32 @@ class FsOfflineServingClient:
|
|
46
47
|
Querying offline features store
|
47
48
|
"""
|
48
49
|
|
49
|
-
def __init__(self, grpc_channel
|
50
|
-
self._client =
|
50
|
+
def __init__(self, grpc_channel: Optional[grpc.Channel] = None):
|
51
|
+
self._client = self._create_client(grpc_channel)
|
52
|
+
|
53
|
+
@staticmethod
|
54
|
+
def _get_offline_serving_url() -> str:
|
55
|
+
"""
|
56
|
+
Fetches the offline serving service URL from the LocationDiscoveryService.
|
57
|
+
"""
|
58
|
+
return LocationDiscoveryClient().get_offline_serving().service_url
|
59
|
+
|
60
|
+
def _create_client(
|
61
|
+
self, grpc_channel: Optional[grpc.Channel] = None
|
62
|
+
) -> FeatureStoreOfflineServingAsyncServiceStub:
|
63
|
+
if grpc_channel:
|
64
|
+
return FeatureStoreOfflineServingAsyncServiceStub(grpc_channel)
|
65
|
+
|
66
|
+
channel = create_grpc_channel(
|
67
|
+
url=self._get_offline_serving_url(),
|
68
|
+
enable_ssl=True,
|
69
|
+
status_for_retry=(
|
70
|
+
grpc.StatusCode.UNAVAILABLE,
|
71
|
+
grpc.StatusCode.CANCELLED,
|
72
|
+
grpc.StatusCode.DEADLINE_EXCEEDED,
|
73
|
+
),
|
74
|
+
)
|
75
|
+
return FeatureStoreOfflineServingAsyncServiceStub(channel)
|
51
76
|
|
52
77
|
def get_population_file_upload_url(
|
53
78
|
self,
|
@@ -0,0 +1 @@
|
|
1
|
+
from .client import LocationDiscoveryClient
|
@@ -0,0 +1,73 @@
|
|
1
|
+
from typing import Callable
|
2
|
+
|
3
|
+
import grpc
|
4
|
+
from _qwak_proto.qwak.service_discovery.service_discovery_location_pb2 import (
|
5
|
+
ServiceLocationDescriptor,
|
6
|
+
)
|
7
|
+
from _qwak_proto.qwak.service_discovery.service_discovery_location_service_pb2 import (
|
8
|
+
GetServingUrlRequest as ProtoGetServingUrlRequest,
|
9
|
+
GetServingUrlRequestResponse as ProtoGetServingUrlRequestResponse,
|
10
|
+
)
|
11
|
+
from _qwak_proto.qwak.service_discovery.service_discovery_location_service_pb2_grpc import (
|
12
|
+
LocationDiscoveryServiceStub,
|
13
|
+
)
|
14
|
+
from dependency_injector.wiring import Provide
|
15
|
+
from qwak.exceptions import QwakException
|
16
|
+
from qwak.inner.di_configuration import QwakContainer
|
17
|
+
|
18
|
+
|
19
|
+
class LocationDiscoveryClient:
|
20
|
+
"""
|
21
|
+
Client for querying service locations from the LocationDiscoveryService.
|
22
|
+
"""
|
23
|
+
|
24
|
+
def __init__(self, grpc_channel=Provide[QwakContainer.core_grpc_channel]):
|
25
|
+
self._service = LocationDiscoveryServiceStub(grpc_channel)
|
26
|
+
|
27
|
+
@staticmethod
|
28
|
+
def _get_location(
|
29
|
+
method: Callable[
|
30
|
+
[ProtoGetServingUrlRequest], ProtoGetServingUrlRequestResponse
|
31
|
+
],
|
32
|
+
) -> ServiceLocationDescriptor:
|
33
|
+
"""
|
34
|
+
Calls a specific RPC and extracts the service location descriptor.
|
35
|
+
|
36
|
+
Args:
|
37
|
+
method: The gRPC method to call.
|
38
|
+
|
39
|
+
Returns:
|
40
|
+
ServiceLocationDescriptor: Contains service_url and location metadata.
|
41
|
+
"""
|
42
|
+
try:
|
43
|
+
request = ProtoGetServingUrlRequest()
|
44
|
+
response = method(request)
|
45
|
+
return response.location
|
46
|
+
except grpc.RpcError as e:
|
47
|
+
raise QwakException(
|
48
|
+
f"Failed to retrieve service location. Error is: {e.details()}"
|
49
|
+
) from e
|
50
|
+
|
51
|
+
def get_offline_serving(self) -> ServiceLocationDescriptor:
|
52
|
+
"""Fetches the offline serving service location."""
|
53
|
+
return self._get_location(self._service.GetOfflineServingUrl)
|
54
|
+
|
55
|
+
def get_distribution_manager(self) -> ServiceLocationDescriptor:
|
56
|
+
"""Fetches the distribution manager service location."""
|
57
|
+
return self._get_location(self._service.GetDistributionManagerUrl)
|
58
|
+
|
59
|
+
def get_analytics_engine(self) -> ServiceLocationDescriptor:
|
60
|
+
"""Fetches the analytics engine service location."""
|
61
|
+
return self._get_location(self._service.GetAnalyticsEngineUrl)
|
62
|
+
|
63
|
+
def get_metrics_gateway(self) -> ServiceLocationDescriptor:
|
64
|
+
"""Fetches the metrics gateway service location."""
|
65
|
+
return self._get_location(self._service.GetMetricsGatewayUrl)
|
66
|
+
|
67
|
+
def get_features_operator(self) -> ServiceLocationDescriptor:
|
68
|
+
"""Fetches the features operator service location."""
|
69
|
+
return self._get_location(self._service.GetFeaturesOperatorUrl)
|
70
|
+
|
71
|
+
def get_hosting_gateway(self) -> ServiceLocationDescriptor:
|
72
|
+
"""Fetches the hosting gateway service location."""
|
73
|
+
return self._get_location(self._service.GetHostingGatewayUrl)
|
@@ -16,22 +16,3 @@ def _generate_new_col(col_name: str, duplicate_cols_dict: dict):
|
|
16
16
|
return col_name
|
17
17
|
elif len(feature_full_name) == 2 and duplicate_cols_dict[feature_full_name[1]] == 1:
|
18
18
|
return feature_full_name[1]
|
19
|
-
|
20
|
-
|
21
|
-
def normalize_cols(cols) -> List[str]:
|
22
|
-
"""
|
23
|
-
Normalize cols - try to remove leading feature set name from features
|
24
|
-
Args:
|
25
|
-
cols: list of column
|
26
|
-
Return normalized columns
|
27
|
-
"""
|
28
|
-
duplicate_columns_dict = {}
|
29
|
-
for col in cols:
|
30
|
-
feature_full_name: List[str] = col.split(".")
|
31
|
-
if len(feature_full_name) != 2:
|
32
|
-
duplicate_columns_dict[col] = 1
|
33
|
-
else:
|
34
|
-
fs_name = feature_full_name[1]
|
35
|
-
duplicate_columns_dict[fs_name] = duplicate_columns_dict.get(fs_name, 0) + 1
|
36
|
-
cols = [_generate_new_col(col_name, duplicate_columns_dict) for col_name in cols]
|
37
|
-
return cols
|