chalkpy 2.96.3__py3-none-any.whl → 2.96.5__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.
- chalk/_gen/chalk/auth/v1/permissions_pb2.py +11 -3
- chalk/_gen/chalk/auth/v1/permissions_pb2.pyi +4 -0
- chalk/_gen/chalk/graph/v1/graph_pb2.py +92 -92
- chalk/_gen/chalk/python/v1/types_pb2.py +31 -25
- chalk/_gen/chalk/python/v1/types_pb2.pyi +23 -4
- chalk/_gen/chalk/server/v1/benchmark_pb2.py +33 -31
- chalk/_gen/chalk/server/v1/benchmark_pb2.pyi +12 -1
- chalk/_gen/chalk/server/v1/builder_pb2.py +240 -238
- chalk/_gen/chalk/server/v1/builder_pb2.pyi +20 -2
- chalk/_gen/chalk/server/v1/deployment_pb2.py +8 -6
- chalk/_gen/chalk/server/v1/infrastructure_pipelines_pb2.py +76 -0
- chalk/_gen/chalk/server/v1/infrastructure_pipelines_pb2.pyi +92 -0
- chalk/_gen/chalk/server/v1/infrastructure_pipelines_pb2_grpc.py +262 -0
- chalk/_gen/chalk/server/v1/infrastructure_pipelines_pb2_grpc.pyi +86 -0
- chalk/_gen/chalk/server/v1/scheduler_pb2.py +14 -12
- chalk/_gen/chalk/server/v1/scheduler_pb2.pyi +19 -9
- chalk/_gen/chalk/streaming/v1/simple_streaming_service_pb2.py +7 -5
- chalk/_gen/chalk/streaming/v1/simple_streaming_service_pb2.pyi +13 -0
- chalk/_version.py +1 -1
- chalk/features/resolver.py +99 -11
- chalk/functions/__init__.py +69 -0
- chalk/parsed/to_proto.py +3 -1
- {chalkpy-2.96.3.dist-info → chalkpy-2.96.5.dist-info}/METADATA +1 -1
- {chalkpy-2.96.3.dist-info → chalkpy-2.96.5.dist-info}/RECORD +27 -23
- {chalkpy-2.96.3.dist-info → chalkpy-2.96.5.dist-info}/WHEEL +1 -1
- {chalkpy-2.96.3.dist-info → chalkpy-2.96.5.dist-info}/entry_points.txt +0 -0
- {chalkpy-2.96.3.dist-info → chalkpy-2.96.5.dist-info}/top_level.txt +0 -0
|
@@ -21,7 +21,7 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
|
|
24
|
-
b'\n\x1f\x63halk/server/v1/scheduler.proto\x12\x0f\x63halk.server.v1\x1a\x1f\x63halk/auth/v1/permissions.proto\x1a\x1b\x63halk/server/v1/batch.proto\x1a)chalk/server/v1/scheduled_query_run.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xa4\x06\n\x0f\x43ronResolverRun\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12%\n\x0e\x65nvironment_id\x18\x02 \x01(\tR\renvironmentId\x12!\n\x0cresolver_fqn\x18\x03 \x01(\tR\x0bresolverFqn\x12\x12\n\x04kind\x18\x04 \x01(\tR\x04kind\x12+\n\x11schedule_readable\x18\x05 \x01(\tR\x10scheduleReadable\x12\x36\n\x17schedule_resolver_value\x18\x06 \x01(\tR\x15scheduleResolverValue\x12\x39\n\ncreated_at\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tcreatedAt\x12(\n\rdeployment_id\x18\x08 \x01(\tH\x00R\x0c\x64\x65ploymentId\x88\x01\x01\x12\x31\n\x03\x65nd\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01R\x03\x65nd\x88\x01\x01\x12:\n\x05\x62\x61tch\x18\n \x01(\x0b\x32\x1f.chalk.server.v1.BatchOperationH\x02R\x05\x62\x61tch\x88\x01\x01\x12\x46\n\x0ctrigger_kind\x18\x0b \x01(\x0e\x32#.chalk.server.v1.CronRunTriggerKindR\x0btriggerKind\x12@\n\x0blower_bound\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x03R\nlowerBound\x88\x01\x01\x12@\n\x0bupper_bound\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x04R\nupperBound\x88\x01\x01\x12$\n\x0bmax_samples\x18\x0e \x01(\x03H\x05R\nmaxSamples\x88\x01\x01\x12$\n\x0eused_job_queue\x18\x0f \x01(\x08R\x0cusedJobQueueB\x10\n\x0e_deployment_idB\x06\n\x04_endB\x08\n\x06_batchB\x0e\n\x0c_lower_boundB\x0e\n\x0c_upper_boundB\x0e\n\x0c_max_samples"\x9d\x03\n ManualTriggerCronResolverRequest\x12!\n\x0cresolver_fqn\x18\x01 \x01(\tR\x0bresolverFqn\x12$\n\x0bmax_samples\x18\x02 \x01(\x03H\x00R\nmaxSamples\x88\x01\x01\x12@\n\x0blower_bound\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01R\nlowerBound\x88\x01\x01\x12@\n\x0bupper_bound\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x02R\nupperBound\x88\x01\x01\x12\x30\n\x11timestamping_mode\x18\x06 \x01(\tH\x03R\x10timestampingMode\x88\x01\x01\x12$\n\x0bjob_options\x18\x07 \x01(\tH\x04R\njobOptions\x88\x01\x01\x42\x0e\n\x0c_max_samplesB\x0e\n\x0c_lower_boundB\x0e\n\x0c_upper_boundB\x14\n\x12_timestamping_modeB\x0e\n\x0c_job_options"q\n!ManualTriggerCronResolverResponse\x12L\n\x11\x63ron_resolver_run\x18\x01 \x01(\x0b\x32 .chalk.server.v1.CronResolverRunR\x0f\x63ronResolverRun"\x9c\x05\n"ManualTriggerScheduledQueryRequest\x12"\n\rcron_query_id\x18\x01 \x01(\x03R\x0b\x63ronQueryId\x12p\n\x0fplanner_options\x18\x02 \x03(\x0b\x32G.chalk.server.v1.ManualTriggerScheduledQueryRequest.PlannerOptionsEntryR\x0eplannerOptions\x12\x33\n\x15incremental_resolvers\x18\x03 \x03(\tR\x14incrementalResolvers\x12$\n\x0bmax_samples\x18\x04 \x01(\x03H\x01R\nmaxSamples\x88\x01\x01\x12j\n\renv_overrides\x18\x05 \x03(\x0b\x32\x45.chalk.server.v1.ManualTriggerScheduledQueryRequest.EnvOverridesEntryR\x0c\x65nvOverrides\x12(\n\x0f\x63ron_query_name\x18\x06 \x01(\tH\x00R\rcronQueryName\x12*\n\x11store_plan_stages\x18\x07 \x01(\x08R\x0fstorePlanStages\x1aY\n\x13PlannerOptionsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.ValueR\x05value:\x02\x38\x01\x1a?\n\x11\x45nvOverridesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\x42\x17\n\x15\x63ron_query_identifierB\x0e\n\x0c_max_samples"y\n#ManualTriggerScheduledQueryResponse\x12R\n\x13scheduled_query_run\x18\x01 \x01(\x0b\x32".chalk.server.v1.ScheduledQueryRunR\x11scheduledQueryRun"0\n\x1eGetScheduledResolverRunRequest\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id"U\n\x1fGetScheduledResolverRunResponse\x12\x32\n\x03run\x18\x01 \x01(\x0b\x32 .chalk.server.v1.CronResolverRunR\x03run"\
|
|
24
|
+
b'\n\x1f\x63halk/server/v1/scheduler.proto\x12\x0f\x63halk.server.v1\x1a\x1f\x63halk/auth/v1/permissions.proto\x1a\x1b\x63halk/server/v1/batch.proto\x1a)chalk/server/v1/scheduled_query_run.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xa4\x06\n\x0f\x43ronResolverRun\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12%\n\x0e\x65nvironment_id\x18\x02 \x01(\tR\renvironmentId\x12!\n\x0cresolver_fqn\x18\x03 \x01(\tR\x0bresolverFqn\x12\x12\n\x04kind\x18\x04 \x01(\tR\x04kind\x12+\n\x11schedule_readable\x18\x05 \x01(\tR\x10scheduleReadable\x12\x36\n\x17schedule_resolver_value\x18\x06 \x01(\tR\x15scheduleResolverValue\x12\x39\n\ncreated_at\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tcreatedAt\x12(\n\rdeployment_id\x18\x08 \x01(\tH\x00R\x0c\x64\x65ploymentId\x88\x01\x01\x12\x31\n\x03\x65nd\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01R\x03\x65nd\x88\x01\x01\x12:\n\x05\x62\x61tch\x18\n \x01(\x0b\x32\x1f.chalk.server.v1.BatchOperationH\x02R\x05\x62\x61tch\x88\x01\x01\x12\x46\n\x0ctrigger_kind\x18\x0b \x01(\x0e\x32#.chalk.server.v1.CronRunTriggerKindR\x0btriggerKind\x12@\n\x0blower_bound\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x03R\nlowerBound\x88\x01\x01\x12@\n\x0bupper_bound\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x04R\nupperBound\x88\x01\x01\x12$\n\x0bmax_samples\x18\x0e \x01(\x03H\x05R\nmaxSamples\x88\x01\x01\x12$\n\x0eused_job_queue\x18\x0f \x01(\x08R\x0cusedJobQueueB\x10\n\x0e_deployment_idB\x06\n\x04_endB\x08\n\x06_batchB\x0e\n\x0c_lower_boundB\x0e\n\x0c_upper_boundB\x0e\n\x0c_max_samples"\x9d\x03\n ManualTriggerCronResolverRequest\x12!\n\x0cresolver_fqn\x18\x01 \x01(\tR\x0bresolverFqn\x12$\n\x0bmax_samples\x18\x02 \x01(\x03H\x00R\nmaxSamples\x88\x01\x01\x12@\n\x0blower_bound\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01R\nlowerBound\x88\x01\x01\x12@\n\x0bupper_bound\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x02R\nupperBound\x88\x01\x01\x12\x30\n\x11timestamping_mode\x18\x06 \x01(\tH\x03R\x10timestampingMode\x88\x01\x01\x12$\n\x0bjob_options\x18\x07 \x01(\tH\x04R\njobOptions\x88\x01\x01\x42\x0e\n\x0c_max_samplesB\x0e\n\x0c_lower_boundB\x0e\n\x0c_upper_boundB\x14\n\x12_timestamping_modeB\x0e\n\x0c_job_options"q\n!ManualTriggerCronResolverResponse\x12L\n\x11\x63ron_resolver_run\x18\x01 \x01(\x0b\x32 .chalk.server.v1.CronResolverRunR\x0f\x63ronResolverRun"\x9c\x05\n"ManualTriggerScheduledQueryRequest\x12"\n\rcron_query_id\x18\x01 \x01(\x03R\x0b\x63ronQueryId\x12p\n\x0fplanner_options\x18\x02 \x03(\x0b\x32G.chalk.server.v1.ManualTriggerScheduledQueryRequest.PlannerOptionsEntryR\x0eplannerOptions\x12\x33\n\x15incremental_resolvers\x18\x03 \x03(\tR\x14incrementalResolvers\x12$\n\x0bmax_samples\x18\x04 \x01(\x03H\x01R\nmaxSamples\x88\x01\x01\x12j\n\renv_overrides\x18\x05 \x03(\x0b\x32\x45.chalk.server.v1.ManualTriggerScheduledQueryRequest.EnvOverridesEntryR\x0c\x65nvOverrides\x12(\n\x0f\x63ron_query_name\x18\x06 \x01(\tH\x00R\rcronQueryName\x12*\n\x11store_plan_stages\x18\x07 \x01(\x08R\x0fstorePlanStages\x1aY\n\x13PlannerOptionsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.ValueR\x05value:\x02\x38\x01\x1a?\n\x11\x45nvOverridesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\x42\x17\n\x15\x63ron_query_identifierB\x0e\n\x0c_max_samples"y\n#ManualTriggerScheduledQueryResponse\x12R\n\x13scheduled_query_run\x18\x01 \x01(\x0b\x32".chalk.server.v1.ScheduledQueryRunR\x11scheduledQueryRun"0\n\x1eGetScheduledResolverRunRequest\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id"U\n\x1fGetScheduledResolverRunResponse\x12\x32\n\x03run\x18\x01 \x01(\x0b\x32 .chalk.server.v1.CronResolverRunR\x03run"\x97\x04\n ListScheduledResolverRunsRequest\x12;\n\x06\x63ursor\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x02\x18\x01H\x00R\x06\x63ursor\x88\x01\x01\x12\x19\n\x05limit\x18\x03 \x01(\x05H\x01R\x05limit\x88\x01\x01\x12"\n\npage_token\x18\x07 \x01(\tH\x02R\tpageToken\x88\x01\x01\x12,\n\x0fresolver_filter\x18\x02 \x01(\tH\x03R\x0eresolverFilter\x88\x01\x01\x12&\n\x0cresolver_fqn\x18\x08 \x01(\tH\x04R\x0bresolverFqn\x88\x01\x01\x12J\n\rstatus_filter\x18\x06 \x01(\x0e\x32 .chalk.server.v1.OperationStatusH\x05R\x0cstatusFilter\x88\x01\x01\x12\x35\n\x05start\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x06R\x05start\x88\x01\x01\x12\x31\n\x03\x65nd\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x07R\x03\x65nd\x88\x01\x01\x42\t\n\x07_cursorB\x08\n\x06_limitB\r\n\x0b_page_tokenB\x12\n\x10_resolver_filterB\x0f\n\r_resolver_fqnB\x10\n\x0e_status_filterB\x08\n\x06_startB\x06\n\x04_end"\x9a\x01\n!ListScheduledResolverRunsResponse\x12\x34\n\x04runs\x18\x01 \x03(\x0b\x32 .chalk.server.v1.CronResolverRunR\x04runs\x12+\n\x0fnext_page_token\x18\x02 \x01(\tH\x00R\rnextPageToken\x88\x01\x01\x42\x12\n\x10_next_page_token":\n!CancelScheduledResolverRunRequest\x12\x15\n\x06run_id\x18\x01 \x01(\tR\x05runId"a\n"CancelScheduledResolverRunResponse\x12;\n\x08\x63ron_run\x18\x01 \x01(\x0b\x32 .chalk.server.v1.CronResolverRunR\x07\x63ronRun*\x9c\x01\n\x12\x43ronRunTriggerKind\x12%\n!CRON_RUN_TRIGGER_KIND_UNSPECIFIED\x10\x00\x12 \n\x1c\x43RON_RUN_TRIGGER_KIND_MANUAL\x10\x01\x12\x1d\n\x19\x43RON_RUN_TRIGGER_KIND_API\x10\x02\x12\x1e\n\x1a\x43RON_RUN_TRIGGER_KIND_CRON\x10\x03\x32\xc7\x05\n\x10SchedulerService\x12\x87\x01\n\x19ManualTriggerCronResolver\x12\x31.chalk.server.v1.ManualTriggerCronResolverRequest\x1a\x32.chalk.server.v1.ManualTriggerCronResolverResponse"\x03\x80}\x11\x12\x8d\x01\n\x1bManualTriggerScheduledQuery\x12\x33.chalk.server.v1.ManualTriggerScheduledQueryRequest\x1a\x34.chalk.server.v1.ManualTriggerScheduledQueryResponse"\x03\x80}\x11\x12\x81\x01\n\x17GetScheduledResolverRun\x12/.chalk.server.v1.GetScheduledResolverRunRequest\x1a\x30.chalk.server.v1.GetScheduledResolverRunResponse"\x03\x80}\x10\x12\x87\x01\n\x19ListScheduledResolverRuns\x12\x31.chalk.server.v1.ListScheduledResolverRunsRequest\x1a\x32.chalk.server.v1.ListScheduledResolverRunsResponse"\x03\x80}\x10\x12\x8a\x01\n\x1a\x43\x61ncelScheduledResolverRun\x12\x32.chalk.server.v1.CancelScheduledResolverRunRequest\x1a\x33.chalk.server.v1.CancelScheduledResolverRunResponse"\x03\x80}\x11\x42\x97\x01\n\x13\x63om.chalk.server.v1B\x0eSchedulerProtoP\x01Z\x12server/v1;serverv1\xa2\x02\x03\x43SX\xaa\x02\x0f\x43halk.Server.V1\xca\x02\x0f\x43halk\\Server\\V1\xe2\x02\x1b\x43halk\\Server\\V1\\GPBMetadata\xea\x02\x11\x43halk::Server::V1b\x06proto3'
|
|
25
25
|
)
|
|
26
26
|
|
|
27
27
|
_globals = globals()
|
|
@@ -36,6 +36,8 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
|
|
36
36
|
_globals["_MANUALTRIGGERSCHEDULEDQUERYREQUEST_PLANNEROPTIONSENTRY"]._serialized_options = b"8\001"
|
|
37
37
|
_globals["_MANUALTRIGGERSCHEDULEDQUERYREQUEST_ENVOVERRIDESENTRY"]._options = None
|
|
38
38
|
_globals["_MANUALTRIGGERSCHEDULEDQUERYREQUEST_ENVOVERRIDESENTRY"]._serialized_options = b"8\001"
|
|
39
|
+
_globals["_LISTSCHEDULEDRESOLVERRUNSREQUEST"].fields_by_name["cursor"]._options = None
|
|
40
|
+
_globals["_LISTSCHEDULEDRESOLVERRUNSREQUEST"].fields_by_name["cursor"]._serialized_options = b"\030\001"
|
|
39
41
|
_globals["_SCHEDULERSERVICE"].methods_by_name["ManualTriggerCronResolver"]._options = None
|
|
40
42
|
_globals["_SCHEDULERSERVICE"].methods_by_name["ManualTriggerCronResolver"]._serialized_options = b"\200}\021"
|
|
41
43
|
_globals["_SCHEDULERSERVICE"].methods_by_name["ManualTriggerScheduledQuery"]._options = None
|
|
@@ -46,8 +48,8 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
|
|
46
48
|
_globals["_SCHEDULERSERVICE"].methods_by_name["ListScheduledResolverRuns"]._serialized_options = b"\200}\020"
|
|
47
49
|
_globals["_SCHEDULERSERVICE"].methods_by_name["CancelScheduledResolverRun"]._options = None
|
|
48
50
|
_globals["_SCHEDULERSERVICE"].methods_by_name["CancelScheduledResolverRun"]._serialized_options = b"\200}\021"
|
|
49
|
-
_globals["_CRONRUNTRIGGERKIND"]._serialized_start =
|
|
50
|
-
_globals["_CRONRUNTRIGGERKIND"]._serialized_end =
|
|
51
|
+
_globals["_CRONRUNTRIGGERKIND"]._serialized_start = 3344
|
|
52
|
+
_globals["_CRONRUNTRIGGERKIND"]._serialized_end = 3500
|
|
51
53
|
_globals["_CRONRESOLVERRUN"]._serialized_start = 221
|
|
52
54
|
_globals["_CRONRESOLVERRUN"]._serialized_end = 1025
|
|
53
55
|
_globals["_MANUALTRIGGERCRONRESOLVERREQUEST"]._serialized_start = 1028
|
|
@@ -67,13 +69,13 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
|
|
67
69
|
_globals["_GETSCHEDULEDRESOLVERRUNRESPONSE"]._serialized_start = 2402
|
|
68
70
|
_globals["_GETSCHEDULEDRESOLVERRUNRESPONSE"]._serialized_end = 2487
|
|
69
71
|
_globals["_LISTSCHEDULEDRESOLVERRUNSREQUEST"]._serialized_start = 2490
|
|
70
|
-
_globals["_LISTSCHEDULEDRESOLVERRUNSREQUEST"]._serialized_end =
|
|
71
|
-
_globals["_LISTSCHEDULEDRESOLVERRUNSRESPONSE"]._serialized_start =
|
|
72
|
-
_globals["_LISTSCHEDULEDRESOLVERRUNSRESPONSE"]._serialized_end =
|
|
73
|
-
_globals["_CANCELSCHEDULEDRESOLVERRUNREQUEST"]._serialized_start =
|
|
74
|
-
_globals["_CANCELSCHEDULEDRESOLVERRUNREQUEST"]._serialized_end =
|
|
75
|
-
_globals["_CANCELSCHEDULEDRESOLVERRUNRESPONSE"]._serialized_start =
|
|
76
|
-
_globals["_CANCELSCHEDULEDRESOLVERRUNRESPONSE"]._serialized_end =
|
|
77
|
-
_globals["_SCHEDULERSERVICE"]._serialized_start =
|
|
78
|
-
_globals["_SCHEDULERSERVICE"]._serialized_end =
|
|
72
|
+
_globals["_LISTSCHEDULEDRESOLVERRUNSREQUEST"]._serialized_end = 3025
|
|
73
|
+
_globals["_LISTSCHEDULEDRESOLVERRUNSRESPONSE"]._serialized_start = 3028
|
|
74
|
+
_globals["_LISTSCHEDULEDRESOLVERRUNSRESPONSE"]._serialized_end = 3182
|
|
75
|
+
_globals["_CANCELSCHEDULEDRESOLVERRUNREQUEST"]._serialized_start = 3184
|
|
76
|
+
_globals["_CANCELSCHEDULEDRESOLVERRUNREQUEST"]._serialized_end = 3242
|
|
77
|
+
_globals["_CANCELSCHEDULEDRESOLVERRUNRESPONSE"]._serialized_start = 3244
|
|
78
|
+
_globals["_CANCELSCHEDULEDRESOLVERRUNRESPONSE"]._serialized_end = 3341
|
|
79
|
+
_globals["_SCHEDULERSERVICE"]._serialized_start = 3503
|
|
80
|
+
_globals["_SCHEDULERSERVICE"]._serialized_end = 4214
|
|
79
81
|
# @@protoc_insertion_point(module_scope)
|
|
@@ -200,34 +200,44 @@ class GetScheduledResolverRunResponse(_message.Message):
|
|
|
200
200
|
def __init__(self, run: _Optional[_Union[CronResolverRun, _Mapping]] = ...) -> None: ...
|
|
201
201
|
|
|
202
202
|
class ListScheduledResolverRunsRequest(_message.Message):
|
|
203
|
-
__slots__ = ("cursor", "
|
|
203
|
+
__slots__ = ("cursor", "limit", "page_token", "resolver_filter", "resolver_fqn", "status_filter", "start", "end")
|
|
204
204
|
CURSOR_FIELD_NUMBER: _ClassVar[int]
|
|
205
|
-
RESOLVER_FILTER_FIELD_NUMBER: _ClassVar[int]
|
|
206
205
|
LIMIT_FIELD_NUMBER: _ClassVar[int]
|
|
206
|
+
PAGE_TOKEN_FIELD_NUMBER: _ClassVar[int]
|
|
207
|
+
RESOLVER_FILTER_FIELD_NUMBER: _ClassVar[int]
|
|
208
|
+
RESOLVER_FQN_FIELD_NUMBER: _ClassVar[int]
|
|
209
|
+
STATUS_FILTER_FIELD_NUMBER: _ClassVar[int]
|
|
207
210
|
START_FIELD_NUMBER: _ClassVar[int]
|
|
208
211
|
END_FIELD_NUMBER: _ClassVar[int]
|
|
209
|
-
STATUS_FILTER_FIELD_NUMBER: _ClassVar[int]
|
|
210
212
|
cursor: _timestamp_pb2.Timestamp
|
|
211
|
-
resolver_filter: str
|
|
212
213
|
limit: int
|
|
214
|
+
page_token: str
|
|
215
|
+
resolver_filter: str
|
|
216
|
+
resolver_fqn: str
|
|
217
|
+
status_filter: _batch_pb2.OperationStatus
|
|
213
218
|
start: _timestamp_pb2.Timestamp
|
|
214
219
|
end: _timestamp_pb2.Timestamp
|
|
215
|
-
status_filter: _batch_pb2.OperationStatus
|
|
216
220
|
def __init__(
|
|
217
221
|
self,
|
|
218
222
|
cursor: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ...,
|
|
219
|
-
resolver_filter: _Optional[str] = ...,
|
|
220
223
|
limit: _Optional[int] = ...,
|
|
224
|
+
page_token: _Optional[str] = ...,
|
|
225
|
+
resolver_filter: _Optional[str] = ...,
|
|
226
|
+
resolver_fqn: _Optional[str] = ...,
|
|
227
|
+
status_filter: _Optional[_Union[_batch_pb2.OperationStatus, str]] = ...,
|
|
221
228
|
start: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ...,
|
|
222
229
|
end: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ...,
|
|
223
|
-
status_filter: _Optional[_Union[_batch_pb2.OperationStatus, str]] = ...,
|
|
224
230
|
) -> None: ...
|
|
225
231
|
|
|
226
232
|
class ListScheduledResolverRunsResponse(_message.Message):
|
|
227
|
-
__slots__ = ("runs",)
|
|
233
|
+
__slots__ = ("runs", "next_page_token")
|
|
228
234
|
RUNS_FIELD_NUMBER: _ClassVar[int]
|
|
235
|
+
NEXT_PAGE_TOKEN_FIELD_NUMBER: _ClassVar[int]
|
|
229
236
|
runs: _containers.RepeatedCompositeFieldContainer[CronResolverRun]
|
|
230
|
-
|
|
237
|
+
next_page_token: str
|
|
238
|
+
def __init__(
|
|
239
|
+
self, runs: _Optional[_Iterable[_Union[CronResolverRun, _Mapping]]] = ..., next_page_token: _Optional[str] = ...
|
|
240
|
+
) -> None: ...
|
|
231
241
|
|
|
232
242
|
class CancelScheduledResolverRunRequest(_message.Message):
|
|
233
243
|
__slots__ = ("run_id",)
|
|
@@ -18,7 +18,7 @@ from chalk._gen.chalk.common.v1 import chalk_error_pb2 as chalk_dot_common_dot_v
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
|
|
21
|
-
b'\n1chalk/streaming/v1/simple_streaming_service.proto\x12\x12\x63halk.streaming.v1\x1a\x1f\x63halk/auth/v1/permissions.proto\x1a!chalk/common/v1/chalk_error.proto"\xa0\x01\n\x0eStreamingError\x12\x31\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x1b.chalk.common.v1.ChalkErrorR\x05\x65rror\x12\x38\n\x05phase\x18\x02 \x01(\x0e\x32".chalk.streaming.v1.ExecutionPhaseR\x05phase\x12!\n\x0coperation_id\x18\x03 \x01(\tR\x0boperationId"\xd6\x01\n!SimpleStreamingUnaryInvokeRequest\x12\x34\n\x16streaming_resolver_fqn\x18\x01 \x01(\tR\x14streamingResolverFqn\x12\x1d\n\ninput_data\x18\x02 \x01(\x0cR\tinputData\x12&\n\x0coperation_id\x18\x03 \x01(\tH\x00R\x0boperationId\x88\x01\x01\x12\x19\n\x05\x64\x65\x62ug\x18\x04 \x01(\x08H\x01R\x05\x64\x65\x62ug\x88\x01\x01\x42\x0f\n\r_operation_idB\x08\n\x06_debug"\xe7\x02\n"SimpleStreamingUnaryInvokeResponse\x12(\n\x10num_rows_succeed\x18\x01 \x01(\x03R\x0enumRowsSucceed\x12&\n\x0fnum_rows_failed\x18\x02 \x01(\x03R\rnumRowsFailed\x12(\n\x10num_rows_skipped\x18\x03 \x01(\x03R\x0enumRowsSkipped\x12\x36\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x1b.chalk.common.v1.ChalkErrorH\x00R\x05\x65rror\x88\x01\x01\x12$\n\x0boutput_data\x18\x05 \x01(\x0cH\x01R\noutputData\x88\x01\x01\x12M\n\x10\x65xecution_errors\x18\x06 \x03(\x0b\x32".chalk.streaming.v1.StreamingErrorR\x0f\x65xecutionErrorsB\x08\n\x06_errorB\x0e\n\x0c_output_data"\xb5\x02\n\x1cTestStreamingResolverRequest\x12&\n\x0cresolver_fqn\x18\x01 \x01(\tH\x00R\x0bresolverFqn\x88\x01\x01\x12@\n\x1astatic_stream_resolver_b64\x18\x02 \x01(\tH\x01R\x17staticStreamResolverB64\x88\x01\x01\x12\x1d\n\ninput_data\x18\x03 \x01(\x0cR\tinputData\x12&\n\x0coperation_id\x18\x04 \x01(\tH\x02R\x0boperationId\x88\x01\x01\x12\x19\n\x05\x64\x65\x62ug\x18\x05 \x01(\x08H\x03R\x05\x64\x65\x62ug\x88\x01\x01\x42\x0f\n\r_resolver_fqnB\x1d\n\x1b_static_stream_resolver_b64B\x0f\n\r_operation_idB\x08\n\x06_debug"\xe1\x01\n\x1dTestStreamingResolverResponse\x12\x44\n\x06status\x18\x01 \x01(\x0e\x32,.chalk.streaming.v1.TestStreamResolverStatusR\x06status\x12\x1e\n\x08\x64\x61ta_uri\x18\x02 \x01(\tH\x00R\x07\x64\x61taUri\x88\x01\x01\x12\x33\n\x06\x65rrors\x18\x03 \x03(\x0b\x32\x1b.chalk.common.v1.ChalkErrorR\x06\x65rrors\x12\x18\n\x07message\x18\x04 \x01(\tR\x07messageB\x0b\n\t_data_uri*\xc5\x01\n\x0e\x45xecutionPhase\x12\x1f\n\x1b\x45XECUTION_PHASE_UNSPECIFIED\x10\x00\x12\x19\n\x15\x45XECUTION_PHASE_PARSE\x10\x01\x12\x1b\n\x17\x45XECUTION_PHASE_MAPPING\x10\x02\x12\x1f\n\x1b\x45XECUTION_PHASE_PERSISTENCE\x10\x03\x12\x1f\n\x1b\x45XECUTION_PHASE_AGGREGATION\x10\x04\x12\x18\n\x14\x45XECUTION_PHASE_SINK\x10\x05*\x99\x01\n\x18TestStreamResolverStatus\x12+\n\'TEST_STREAM_RESOLVER_STATUS_UNSPECIFIED\x10\x00\x12\'\n#TEST_STREAM_RESOLVER_STATUS_SUCCESS\x10\x01\x12\'\n#TEST_STREAM_RESOLVER_STATUS_FAILURE\x10\x02\x32\xaf\x02\n\x16SimpleStreamingService\x12\x90\x01\n\x1aSimpleStreamingUnaryInvoke\x12\x35.chalk.streaming.v1.SimpleStreamingUnaryInvokeRequest\x1a\x36.chalk.streaming.v1.SimpleStreamingUnaryInvokeResponse"\x03\x80}\x02\x12\x81\x01\n\x15TestStreamingResolver\x12\x30.chalk.streaming.v1.TestStreamingResolverRequest\x1a\x31.chalk.streaming.v1.TestStreamingResolverResponse"\x03\x80}\x02\x42\x9f\x01\n\x16\x63om.chalk.streaming.v1B\x1bSimpleStreamingServiceProtoP\x01\xa2\x02\x03\x43SX\xaa\x02\x12\x43halk.Streaming.V1\xca\x02\x12\x43halk\\Streaming\\V1\xe2\x02\x1e\x43halk\\Streaming\\V1\\GPBMetadata\xea\x02\x14\x43halk::Streaming::V1b\x06proto3'
|
|
21
|
+
b'\n1chalk/streaming/v1/simple_streaming_service.proto\x12\x12\x63halk.streaming.v1\x1a\x1f\x63halk/auth/v1/permissions.proto\x1a!chalk/common/v1/chalk_error.proto"\xa0\x01\n\x0eStreamingError\x12\x31\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x1b.chalk.common.v1.ChalkErrorR\x05\x65rror\x12\x38\n\x05phase\x18\x02 \x01(\x0e\x32".chalk.streaming.v1.ExecutionPhaseR\x05phase\x12!\n\x0coperation_id\x18\x03 \x01(\tR\x0boperationId"\xd6\x01\n!SimpleStreamingUnaryInvokeRequest\x12\x34\n\x16streaming_resolver_fqn\x18\x01 \x01(\tR\x14streamingResolverFqn\x12\x1d\n\ninput_data\x18\x02 \x01(\x0cR\tinputData\x12&\n\x0coperation_id\x18\x03 \x01(\tH\x00R\x0boperationId\x88\x01\x01\x12\x19\n\x05\x64\x65\x62ug\x18\x04 \x01(\x08H\x01R\x05\x64\x65\x62ug\x88\x01\x01\x42\x0f\n\r_operation_idB\x08\n\x06_debug"\xe7\x02\n"SimpleStreamingUnaryInvokeResponse\x12(\n\x10num_rows_succeed\x18\x01 \x01(\x03R\x0enumRowsSucceed\x12&\n\x0fnum_rows_failed\x18\x02 \x01(\x03R\rnumRowsFailed\x12(\n\x10num_rows_skipped\x18\x03 \x01(\x03R\x0enumRowsSkipped\x12\x36\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x1b.chalk.common.v1.ChalkErrorH\x00R\x05\x65rror\x88\x01\x01\x12$\n\x0boutput_data\x18\x05 \x01(\x0cH\x01R\noutputData\x88\x01\x01\x12M\n\x10\x65xecution_errors\x18\x06 \x03(\x0b\x32".chalk.streaming.v1.StreamingErrorR\x0f\x65xecutionErrorsB\x08\n\x06_errorB\x0e\n\x0c_output_data"\xb5\x02\n\x1cTestStreamingResolverRequest\x12&\n\x0cresolver_fqn\x18\x01 \x01(\tH\x00R\x0bresolverFqn\x88\x01\x01\x12@\n\x1astatic_stream_resolver_b64\x18\x02 \x01(\tH\x01R\x17staticStreamResolverB64\x88\x01\x01\x12\x1d\n\ninput_data\x18\x03 \x01(\x0cR\tinputData\x12&\n\x0coperation_id\x18\x04 \x01(\tH\x02R\x0boperationId\x88\x01\x01\x12\x19\n\x05\x64\x65\x62ug\x18\x05 \x01(\x08H\x03R\x05\x64\x65\x62ug\x88\x01\x01\x42\x0f\n\r_resolver_fqnB\x1d\n\x1b_static_stream_resolver_b64B\x0f\n\r_operation_idB\x08\n\x06_debug"\xe1\x01\n\x1dTestStreamingResolverResponse\x12\x44\n\x06status\x18\x01 \x01(\x0e\x32,.chalk.streaming.v1.TestStreamResolverStatusR\x06status\x12\x1e\n\x08\x64\x61ta_uri\x18\x02 \x01(\tH\x00R\x07\x64\x61taUri\x88\x01\x01\x12\x33\n\x06\x65rrors\x18\x03 \x03(\x0b\x32\x1b.chalk.common.v1.ChalkErrorR\x06\x65rrors\x12\x18\n\x07message\x18\x04 \x01(\tR\x07messageB\x0b\n\t_data_uri*\xc5\x01\n\x0e\x45xecutionPhase\x12\x1f\n\x1b\x45XECUTION_PHASE_UNSPECIFIED\x10\x00\x12\x19\n\x15\x45XECUTION_PHASE_PARSE\x10\x01\x12\x1b\n\x17\x45XECUTION_PHASE_MAPPING\x10\x02\x12\x1f\n\x1b\x45XECUTION_PHASE_PERSISTENCE\x10\x03\x12\x1f\n\x1b\x45XECUTION_PHASE_AGGREGATION\x10\x04\x12\x18\n\x14\x45XECUTION_PHASE_SINK\x10\x05*\xe4\x01\n\x16StreamingMessageStatus\x12(\n$STREAMING_MESSAGE_STATUS_UNSPECIFIED\x10\x00\x12)\n%STREAMING_MESSAGE_STATUS_PARSE_FAILED\x10\x01\x12*\n&STREAMING_MESSAGE_STATUS_PARSE_SKIPPED\x10\x02\x12#\n\x1fSTREAMING_MESSAGE_STATUS_FAILED\x10\x03\x12$\n STREAMING_MESSAGE_STATUS_SUCCESS\x10\x04*\x99\x01\n\x18TestStreamResolverStatus\x12+\n\'TEST_STREAM_RESOLVER_STATUS_UNSPECIFIED\x10\x00\x12\'\n#TEST_STREAM_RESOLVER_STATUS_SUCCESS\x10\x01\x12\'\n#TEST_STREAM_RESOLVER_STATUS_FAILURE\x10\x02\x32\xaf\x02\n\x16SimpleStreamingService\x12\x90\x01\n\x1aSimpleStreamingUnaryInvoke\x12\x35.chalk.streaming.v1.SimpleStreamingUnaryInvokeRequest\x1a\x36.chalk.streaming.v1.SimpleStreamingUnaryInvokeResponse"\x03\x80}\x02\x12\x81\x01\n\x15TestStreamingResolver\x12\x30.chalk.streaming.v1.TestStreamingResolverRequest\x1a\x31.chalk.streaming.v1.TestStreamingResolverResponse"\x03\x80}\x02\x42\x9f\x01\n\x16\x63om.chalk.streaming.v1B\x1bSimpleStreamingServiceProtoP\x01\xa2\x02\x03\x43SX\xaa\x02\x12\x43halk.Streaming.V1\xca\x02\x12\x43halk\\Streaming\\V1\xe2\x02\x1e\x43halk\\Streaming\\V1\\GPBMetadata\xea\x02\x14\x43halk::Streaming::V1b\x06proto3'
|
|
22
22
|
)
|
|
23
23
|
|
|
24
24
|
_globals = globals()
|
|
@@ -35,8 +35,10 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
|
|
35
35
|
_globals["_SIMPLESTREAMINGSERVICE"].methods_by_name["TestStreamingResolver"]._serialized_options = b"\200}\002"
|
|
36
36
|
_globals["_EXECUTIONPHASE"]._serialized_start = 1424
|
|
37
37
|
_globals["_EXECUTIONPHASE"]._serialized_end = 1621
|
|
38
|
-
_globals["
|
|
39
|
-
_globals["
|
|
38
|
+
_globals["_STREAMINGMESSAGESTATUS"]._serialized_start = 1624
|
|
39
|
+
_globals["_STREAMINGMESSAGESTATUS"]._serialized_end = 1852
|
|
40
|
+
_globals["_TESTSTREAMRESOLVERSTATUS"]._serialized_start = 1855
|
|
41
|
+
_globals["_TESTSTREAMRESOLVERSTATUS"]._serialized_end = 2008
|
|
40
42
|
_globals["_STREAMINGERROR"]._serialized_start = 142
|
|
41
43
|
_globals["_STREAMINGERROR"]._serialized_end = 302
|
|
42
44
|
_globals["_SIMPLESTREAMINGUNARYINVOKEREQUEST"]._serialized_start = 305
|
|
@@ -47,6 +49,6 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
|
|
47
49
|
_globals["_TESTSTREAMINGRESOLVERREQUEST"]._serialized_end = 1193
|
|
48
50
|
_globals["_TESTSTREAMINGRESOLVERRESPONSE"]._serialized_start = 1196
|
|
49
51
|
_globals["_TESTSTREAMINGRESOLVERRESPONSE"]._serialized_end = 1421
|
|
50
|
-
_globals["_SIMPLESTREAMINGSERVICE"]._serialized_start =
|
|
51
|
-
_globals["_SIMPLESTREAMINGSERVICE"]._serialized_end =
|
|
52
|
+
_globals["_SIMPLESTREAMINGSERVICE"]._serialized_start = 2011
|
|
53
|
+
_globals["_SIMPLESTREAMINGSERVICE"]._serialized_end = 2314
|
|
52
54
|
# @@protoc_insertion_point(module_scope)
|
|
@@ -23,6 +23,14 @@ class ExecutionPhase(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
|
23
23
|
EXECUTION_PHASE_AGGREGATION: _ClassVar[ExecutionPhase]
|
|
24
24
|
EXECUTION_PHASE_SINK: _ClassVar[ExecutionPhase]
|
|
25
25
|
|
|
26
|
+
class StreamingMessageStatus(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
27
|
+
__slots__ = ()
|
|
28
|
+
STREAMING_MESSAGE_STATUS_UNSPECIFIED: _ClassVar[StreamingMessageStatus]
|
|
29
|
+
STREAMING_MESSAGE_STATUS_PARSE_FAILED: _ClassVar[StreamingMessageStatus]
|
|
30
|
+
STREAMING_MESSAGE_STATUS_PARSE_SKIPPED: _ClassVar[StreamingMessageStatus]
|
|
31
|
+
STREAMING_MESSAGE_STATUS_FAILED: _ClassVar[StreamingMessageStatus]
|
|
32
|
+
STREAMING_MESSAGE_STATUS_SUCCESS: _ClassVar[StreamingMessageStatus]
|
|
33
|
+
|
|
26
34
|
class TestStreamResolverStatus(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
27
35
|
__slots__ = ()
|
|
28
36
|
TEST_STREAM_RESOLVER_STATUS_UNSPECIFIED: _ClassVar[TestStreamResolverStatus]
|
|
@@ -35,6 +43,11 @@ EXECUTION_PHASE_MAPPING: ExecutionPhase
|
|
|
35
43
|
EXECUTION_PHASE_PERSISTENCE: ExecutionPhase
|
|
36
44
|
EXECUTION_PHASE_AGGREGATION: ExecutionPhase
|
|
37
45
|
EXECUTION_PHASE_SINK: ExecutionPhase
|
|
46
|
+
STREAMING_MESSAGE_STATUS_UNSPECIFIED: StreamingMessageStatus
|
|
47
|
+
STREAMING_MESSAGE_STATUS_PARSE_FAILED: StreamingMessageStatus
|
|
48
|
+
STREAMING_MESSAGE_STATUS_PARSE_SKIPPED: StreamingMessageStatus
|
|
49
|
+
STREAMING_MESSAGE_STATUS_FAILED: StreamingMessageStatus
|
|
50
|
+
STREAMING_MESSAGE_STATUS_SUCCESS: StreamingMessageStatus
|
|
38
51
|
TEST_STREAM_RESOLVER_STATUS_UNSPECIFIED: TestStreamResolverStatus
|
|
39
52
|
TEST_STREAM_RESOLVER_STATUS_SUCCESS: TestStreamResolverStatus
|
|
40
53
|
TEST_STREAM_RESOLVER_STATUS_FAILURE: TestStreamResolverStatus
|
chalk/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "2.96.
|
|
1
|
+
__version__ = "2.96.5"
|
chalk/features/resolver.py
CHANGED
|
@@ -3812,6 +3812,7 @@ def make_stream_resolver(
|
|
|
3812
3812
|
owner: Optional[str] = None,
|
|
3813
3813
|
doc: str | None = None,
|
|
3814
3814
|
sink: Sink | None = None,
|
|
3815
|
+
additional_output_features: Iterable[FeatureWrapper | str] | None = None,
|
|
3815
3816
|
skip_online: bool = False,
|
|
3816
3817
|
skip_offline: bool = False,
|
|
3817
3818
|
) -> StreamResolver:
|
|
@@ -3846,6 +3847,10 @@ def make_stream_resolver(
|
|
|
3846
3847
|
sink
|
|
3847
3848
|
An optional message producer configuration that specifies where to send messages.
|
|
3848
3849
|
Read more at https://docs.chalk.ai/api-docs#Sink
|
|
3850
|
+
additional_output_features
|
|
3851
|
+
An optional iterable of additional features to compute and persist to the online store
|
|
3852
|
+
without publishing to an auxiliary stream. Mutually exclusive with `sink`.
|
|
3853
|
+
Use this when you want to enrich features without setting up stream publishing infrastructure.
|
|
3849
3854
|
skip_online
|
|
3850
3855
|
If True, skip online persistence (no writes to Redis/DynamoDB/etc).
|
|
3851
3856
|
Results will still be processed but not stored in online stores.
|
|
@@ -3888,6 +3893,18 @@ def make_stream_resolver(
|
|
|
3888
3893
|
range=error_builder.function_arg_range_by_name("source"),
|
|
3889
3894
|
)
|
|
3890
3895
|
|
|
3896
|
+
# Validate that sink and additional_output_features are mutually exclusive
|
|
3897
|
+
if sink is not None and additional_output_features is not None:
|
|
3898
|
+
error_builder.add_diagnostic(
|
|
3899
|
+
message=(
|
|
3900
|
+
"Cannot specify both 'sink' and 'additional_output_features'. "
|
|
3901
|
+
+ "If you're using Sink, add all desired features to Sink.output_features instead."
|
|
3902
|
+
),
|
|
3903
|
+
code="208",
|
|
3904
|
+
label="Use Sink.output_features for all features",
|
|
3905
|
+
range=error_builder.function_arg_range_by_name("additional_output_features"),
|
|
3906
|
+
)
|
|
3907
|
+
|
|
3891
3908
|
# Validate name is a string
|
|
3892
3909
|
if not isinstance(name, str): # pyright: ignore[reportUnnecessaryIsInstance]
|
|
3893
3910
|
error_builder.add_diagnostic(
|
|
@@ -3992,12 +4009,16 @@ def make_stream_resolver(
|
|
|
3992
4009
|
f"Native streaming resolvers only support python parse functions with input bytes 'bytes'. Function {parse} has input type {parse_info.input_type}"
|
|
3993
4010
|
)
|
|
3994
4011
|
|
|
3995
|
-
# Validate and parse sink before creating StreamResolver
|
|
4012
|
+
# Validate and parse sink or additional_output_features before creating StreamResolver
|
|
3996
4013
|
message_producer_parsed: StreamResolverMessageProducerParsed | None = None
|
|
3997
4014
|
if sink is not None:
|
|
3998
4015
|
message_producer_parsed = parse_message_producer_with_lsp_errors(
|
|
3999
4016
|
sink, error_builder, "sink", message_type, name
|
|
4000
4017
|
)
|
|
4018
|
+
elif additional_output_features is not None:
|
|
4019
|
+
message_producer_parsed = parse_additional_output_features_with_lsp_errors(
|
|
4020
|
+
additional_output_features, error_builder, "additional_output_features", message_type, name
|
|
4021
|
+
)
|
|
4001
4022
|
|
|
4002
4023
|
resolver = StreamResolver(
|
|
4003
4024
|
function_definition=caller_source,
|
|
@@ -4038,25 +4059,22 @@ def make_stream_resolver(
|
|
|
4038
4059
|
return resolver
|
|
4039
4060
|
|
|
4040
4061
|
|
|
4041
|
-
@dataclass
|
|
4062
|
+
@dataclass(kw_only=True)
|
|
4042
4063
|
class Sink:
|
|
4043
|
-
"""
|
|
4044
|
-
|
|
4045
|
-
Messages are arrow tables serialized in IPC stream format with the specified output columns
|
|
4046
|
-
"""
|
|
4064
|
+
"""Computes additional output features and sends them to a stream source."""
|
|
4047
4065
|
|
|
4048
4066
|
send_to: StreamSource
|
|
4049
|
-
"""The source to send results to"""
|
|
4067
|
+
"""The stream source to send results to."""
|
|
4050
4068
|
|
|
4051
4069
|
output_features: Iterable[FeatureWrapper | str]
|
|
4052
4070
|
"""
|
|
4053
4071
|
The requested output features. These can include both features returned by the stream resolvers and
|
|
4054
|
-
other features retrievable via online query given the stream resolver outputs as inputs.
|
|
4055
|
-
the stream will have these output features as columns
|
|
4072
|
+
other features retrievable via online query given the stream resolver outputs as inputs.
|
|
4073
|
+
The message sent to the stream will have these output features as columns.
|
|
4056
4074
|
"""
|
|
4057
4075
|
|
|
4058
4076
|
format: Literal["json", "ipc_stream"] = "ipc_stream"
|
|
4059
|
-
"""Format of messages sent"""
|
|
4077
|
+
"""Format of messages sent."""
|
|
4060
4078
|
|
|
4061
4079
|
feature_expressions: Mapping[FeatureWrapper | str, Underscore] | None = None
|
|
4062
4080
|
|
|
@@ -4184,10 +4202,80 @@ def parse_message_producer_with_lsp_errors(
|
|
|
4184
4202
|
)
|
|
4185
4203
|
|
|
4186
4204
|
|
|
4205
|
+
def parse_additional_output_features_with_lsp_errors(
|
|
4206
|
+
output_features_input: Iterable[FeatureWrapper | str],
|
|
4207
|
+
error_builder: FunctionCallErrorBuilder,
|
|
4208
|
+
param_name: str,
|
|
4209
|
+
message_type: Type[BaseModel | google.protobuf.message.Message | AnyDataclass | str | bytes],
|
|
4210
|
+
resolver_name: str,
|
|
4211
|
+
) -> StreamResolverMessageProducerParsed | None:
|
|
4212
|
+
"""Parse additional_output_features into StreamResolverMessageProducerParsed.
|
|
4213
|
+
|
|
4214
|
+
Similar to parse_message_producer_with_lsp_errors but for additional_output_features
|
|
4215
|
+
parameter, which doesn't require a send_to destination.
|
|
4216
|
+
"""
|
|
4217
|
+
# Validate output_features is iterable
|
|
4218
|
+
if not isinstance(output_features_input, collections.abc.Iterable): # pyright: ignore[reportUnnecessaryIsInstance]
|
|
4219
|
+
error_builder.add_diagnostic(
|
|
4220
|
+
message="Expected an iterable for argument 'additional_output_features'",
|
|
4221
|
+
code="209",
|
|
4222
|
+
label="Invalid additional_output_features type",
|
|
4223
|
+
range=error_builder.function_arg_range_by_name(param_name),
|
|
4224
|
+
)
|
|
4225
|
+
return None
|
|
4226
|
+
|
|
4227
|
+
output_features_list = list(output_features_input)
|
|
4228
|
+
if len(output_features_list) == 0:
|
|
4229
|
+
error_builder.add_diagnostic(
|
|
4230
|
+
message="Expected at least one feature in 'additional_output_features'",
|
|
4231
|
+
code="210",
|
|
4232
|
+
label="Empty additional_output_features",
|
|
4233
|
+
range=error_builder.function_arg_range_by_name(param_name),
|
|
4234
|
+
)
|
|
4235
|
+
return None
|
|
4236
|
+
|
|
4237
|
+
# Validate and unwrap features (same logic as parse_message_producer_with_lsp_errors)
|
|
4238
|
+
unwrapped_features: list[Feature] = []
|
|
4239
|
+
for f in output_features_list:
|
|
4240
|
+
if isinstance(f, FeatureWrapper):
|
|
4241
|
+
unwrapped_features.append(unwrap_feature(f))
|
|
4242
|
+
elif isinstance(f, str): # pyright: ignore[reportUnnecessaryIsInstance]
|
|
4243
|
+
try:
|
|
4244
|
+
feature = Feature.from_root_fqn(f)
|
|
4245
|
+
unwrapped_features.append(feature)
|
|
4246
|
+
except Exception:
|
|
4247
|
+
error_builder.add_diagnostic(
|
|
4248
|
+
message=f"Invalid feature FQN '{f}' in additional_output_features",
|
|
4249
|
+
code="211",
|
|
4250
|
+
label="Invalid feature FQN",
|
|
4251
|
+
range=error_builder.function_arg_range_by_name(param_name),
|
|
4252
|
+
)
|
|
4253
|
+
return None
|
|
4254
|
+
else:
|
|
4255
|
+
error_builder.add_diagnostic(
|
|
4256
|
+
message=f"Feature '{f}' must be a Feature or string, got {type(f)} instead",
|
|
4257
|
+
code="212",
|
|
4258
|
+
label="Invalid feature type",
|
|
4259
|
+
range=error_builder.function_arg_range_by_name(param_name),
|
|
4260
|
+
)
|
|
4261
|
+
return None
|
|
4262
|
+
|
|
4263
|
+
# Reuse existing validation
|
|
4264
|
+
_validate_output_features(unwrapped_features, error_builder, resolver_name)
|
|
4265
|
+
|
|
4266
|
+
# Create StreamResolverMessageProducerParsed with send_to=None
|
|
4267
|
+
return StreamResolverMessageProducerParsed(
|
|
4268
|
+
output_features=[str(f) for f in output_features_list],
|
|
4269
|
+
format="ipc_stream",
|
|
4270
|
+
send_to=None,
|
|
4271
|
+
feature_expressions=None,
|
|
4272
|
+
)
|
|
4273
|
+
|
|
4274
|
+
|
|
4187
4275
|
class StreamResolverMessageProducerParsed:
|
|
4188
4276
|
def __init__(
|
|
4189
4277
|
self,
|
|
4190
|
-
send_to: StreamSource,
|
|
4278
|
+
send_to: StreamSource | None,
|
|
4191
4279
|
output_features: list[str],
|
|
4192
4280
|
format: Literal["json", "ipc_stream"],
|
|
4193
4281
|
feature_expressions: Mapping[str, Underscore] | None = None,
|
chalk/functions/__init__.py
CHANGED
|
@@ -391,6 +391,40 @@ def substr(expr: Underscore | Any, start: int, length: int | None = None):
|
|
|
391
391
|
return UnderscoreFunction("substr", expr, start + 1, length)
|
|
392
392
|
|
|
393
393
|
|
|
394
|
+
def str_slice(expr: Underscore | Any, start: int, end: int):
|
|
395
|
+
"""
|
|
396
|
+
Extract a substring from a string using start and end indices.
|
|
397
|
+
|
|
398
|
+
This is a convenience function that wraps `substr` with Python-style slicing semantics,
|
|
399
|
+
where you provide start and end indices rather than start and length.
|
|
400
|
+
|
|
401
|
+
Parameters
|
|
402
|
+
----------
|
|
403
|
+
expr
|
|
404
|
+
The string expression to slice.
|
|
405
|
+
start
|
|
406
|
+
The starting index (0-based, inclusive).
|
|
407
|
+
end
|
|
408
|
+
The ending index (0-based, exclusive).
|
|
409
|
+
|
|
410
|
+
Returns
|
|
411
|
+
-------
|
|
412
|
+
A substring from index `start` to `end` (exclusive).
|
|
413
|
+
|
|
414
|
+
Examples
|
|
415
|
+
--------
|
|
416
|
+
>>> import chalk.functions as F
|
|
417
|
+
>>> from chalk.features import _, features
|
|
418
|
+
>>> @features
|
|
419
|
+
... class User:
|
|
420
|
+
... id: str
|
|
421
|
+
... name: str
|
|
422
|
+
... first_three: str = F.str_slice(_.name, 0, 3) # Extract first 3 characters
|
|
423
|
+
... middle: str = F.str_slice(_.name, 2, 5) # Extract characters from index 2 to 4
|
|
424
|
+
"""
|
|
425
|
+
return substr(expr, start, end - start)
|
|
426
|
+
|
|
427
|
+
|
|
394
428
|
def reverse(expr: Underscore | Any):
|
|
395
429
|
"""
|
|
396
430
|
Reverse the order of a string.
|
|
@@ -926,6 +960,38 @@ def strrpos(expr: Any, substring: Any):
|
|
|
926
960
|
return UnderscoreFunction("strrpos", expr, substring) - 1
|
|
927
961
|
|
|
928
962
|
|
|
963
|
+
def str_contains(expr: Any, substring: Any):
|
|
964
|
+
"""
|
|
965
|
+
Check if a string contains a substring.
|
|
966
|
+
|
|
967
|
+
This is a convenience function that checks whether `substring` appears anywhere
|
|
968
|
+
within the string `expr`. It returns a boolean value.
|
|
969
|
+
|
|
970
|
+
Parameters
|
|
971
|
+
----------
|
|
972
|
+
expr
|
|
973
|
+
The string expression to search within.
|
|
974
|
+
substring
|
|
975
|
+
The substring to search for.
|
|
976
|
+
|
|
977
|
+
Returns
|
|
978
|
+
-------
|
|
979
|
+
Boolean indicating whether `substring` is found in `expr`.
|
|
980
|
+
|
|
981
|
+
Examples
|
|
982
|
+
--------
|
|
983
|
+
>>> import chalk.functions as F
|
|
984
|
+
>>> from chalk.features import _, features
|
|
985
|
+
>>> @features
|
|
986
|
+
... class User:
|
|
987
|
+
... id: str
|
|
988
|
+
... email: str
|
|
989
|
+
... is_gmail: bool = F.str_contains(_.email, "@gmail.com")
|
|
990
|
+
... has_admin: bool = F.str_contains(_.email, "admin")
|
|
991
|
+
"""
|
|
992
|
+
return strpos(expr, substring) >= 0
|
|
993
|
+
|
|
994
|
+
|
|
929
995
|
def chr(code: Underscore | Any):
|
|
930
996
|
"""
|
|
931
997
|
Convert Unicode code point to character.
|
|
@@ -5988,6 +6054,7 @@ __all__ = (
|
|
|
5988
6054
|
"h3_cell_to_lat_lon",
|
|
5989
6055
|
"if_then_else",
|
|
5990
6056
|
"inference",
|
|
6057
|
+
"is_in",
|
|
5991
6058
|
"is_leap_year",
|
|
5992
6059
|
"is_month_end",
|
|
5993
6060
|
"is_not_null",
|
|
@@ -6078,6 +6145,8 @@ __all__ = (
|
|
|
6078
6145
|
"strpos",
|
|
6079
6146
|
"strrpos",
|
|
6080
6147
|
"struct_pack",
|
|
6148
|
+
"str_contains",
|
|
6149
|
+
"str_slice",
|
|
6081
6150
|
"substr",
|
|
6082
6151
|
"to_base",
|
|
6083
6152
|
"to_iso8601",
|
chalk/parsed/to_proto.py
CHANGED
|
@@ -1337,7 +1337,9 @@ class ToProtoConverter:
|
|
|
1337
1337
|
message_producer: pb.StreamResolverMessageProducerParsed | None = None
|
|
1338
1338
|
if r.message_producer_parsed is not None:
|
|
1339
1339
|
message_producer = pb.StreamResolverMessageProducerParsed(
|
|
1340
|
-
send_to=ToProtoConverter.create_stream_source_reference(r.message_producer_parsed.send_to)
|
|
1340
|
+
send_to=ToProtoConverter.create_stream_source_reference(r.message_producer_parsed.send_to)
|
|
1341
|
+
if r.message_producer_parsed.send_to is not None
|
|
1342
|
+
else None,
|
|
1341
1343
|
output_features=r.message_producer_parsed.output_features,
|
|
1342
1344
|
transformations={
|
|
1343
1345
|
str(k): pb.FeatureExpression(underscore_expr=cls.convert_underscore(v))
|