awx-zipline-ai 0.0.32__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.
Files changed (96) hide show
  1. __init__.py +0 -0
  2. agent/__init__.py +1 -0
  3. agent/constants.py +15 -0
  4. agent/ttypes.py +1684 -0
  5. ai/__init__.py +0 -0
  6. ai/chronon/__init__.py +0 -0
  7. ai/chronon/airflow_helpers.py +248 -0
  8. ai/chronon/cli/__init__.py +0 -0
  9. ai/chronon/cli/compile/__init__.py +0 -0
  10. ai/chronon/cli/compile/column_hashing.py +336 -0
  11. ai/chronon/cli/compile/compile_context.py +173 -0
  12. ai/chronon/cli/compile/compiler.py +183 -0
  13. ai/chronon/cli/compile/conf_validator.py +742 -0
  14. ai/chronon/cli/compile/display/__init__.py +0 -0
  15. ai/chronon/cli/compile/display/class_tracker.py +102 -0
  16. ai/chronon/cli/compile/display/compile_status.py +95 -0
  17. ai/chronon/cli/compile/display/compiled_obj.py +12 -0
  18. ai/chronon/cli/compile/display/console.py +3 -0
  19. ai/chronon/cli/compile/display/diff_result.py +111 -0
  20. ai/chronon/cli/compile/fill_templates.py +35 -0
  21. ai/chronon/cli/compile/parse_configs.py +134 -0
  22. ai/chronon/cli/compile/parse_teams.py +242 -0
  23. ai/chronon/cli/compile/serializer.py +109 -0
  24. ai/chronon/cli/compile/version_utils.py +42 -0
  25. ai/chronon/cli/git_utils.py +145 -0
  26. ai/chronon/cli/logger.py +59 -0
  27. ai/chronon/constants.py +3 -0
  28. ai/chronon/group_by.py +692 -0
  29. ai/chronon/join.py +580 -0
  30. ai/chronon/logger.py +23 -0
  31. ai/chronon/model.py +40 -0
  32. ai/chronon/query.py +126 -0
  33. ai/chronon/repo/__init__.py +39 -0
  34. ai/chronon/repo/aws.py +284 -0
  35. ai/chronon/repo/cluster.py +136 -0
  36. ai/chronon/repo/compile.py +62 -0
  37. ai/chronon/repo/constants.py +164 -0
  38. ai/chronon/repo/default_runner.py +269 -0
  39. ai/chronon/repo/explore.py +418 -0
  40. ai/chronon/repo/extract_objects.py +134 -0
  41. ai/chronon/repo/gcp.py +586 -0
  42. ai/chronon/repo/gitpython_utils.py +15 -0
  43. ai/chronon/repo/hub_runner.py +261 -0
  44. ai/chronon/repo/hub_uploader.py +109 -0
  45. ai/chronon/repo/init.py +60 -0
  46. ai/chronon/repo/join_backfill.py +119 -0
  47. ai/chronon/repo/run.py +296 -0
  48. ai/chronon/repo/serializer.py +133 -0
  49. ai/chronon/repo/team_json_utils.py +46 -0
  50. ai/chronon/repo/utils.py +481 -0
  51. ai/chronon/repo/zipline.py +35 -0
  52. ai/chronon/repo/zipline_hub.py +277 -0
  53. ai/chronon/resources/__init__.py +0 -0
  54. ai/chronon/resources/gcp/__init__.py +0 -0
  55. ai/chronon/resources/gcp/group_bys/__init__.py +0 -0
  56. ai/chronon/resources/gcp/group_bys/test/__init__.py +0 -0
  57. ai/chronon/resources/gcp/group_bys/test/data.py +30 -0
  58. ai/chronon/resources/gcp/joins/__init__.py +0 -0
  59. ai/chronon/resources/gcp/joins/test/__init__.py +0 -0
  60. ai/chronon/resources/gcp/joins/test/data.py +26 -0
  61. ai/chronon/resources/gcp/sources/__init__.py +0 -0
  62. ai/chronon/resources/gcp/sources/test/__init__.py +0 -0
  63. ai/chronon/resources/gcp/sources/test/data.py +26 -0
  64. ai/chronon/resources/gcp/teams.py +58 -0
  65. ai/chronon/source.py +86 -0
  66. ai/chronon/staging_query.py +226 -0
  67. ai/chronon/types.py +58 -0
  68. ai/chronon/utils.py +510 -0
  69. ai/chronon/windows.py +48 -0
  70. awx_zipline_ai-0.0.32.dist-info/METADATA +197 -0
  71. awx_zipline_ai-0.0.32.dist-info/RECORD +96 -0
  72. awx_zipline_ai-0.0.32.dist-info/WHEEL +5 -0
  73. awx_zipline_ai-0.0.32.dist-info/entry_points.txt +2 -0
  74. awx_zipline_ai-0.0.32.dist-info/top_level.txt +4 -0
  75. gen_thrift/__init__.py +0 -0
  76. gen_thrift/api/__init__.py +1 -0
  77. gen_thrift/api/constants.py +15 -0
  78. gen_thrift/api/ttypes.py +3754 -0
  79. gen_thrift/common/__init__.py +1 -0
  80. gen_thrift/common/constants.py +15 -0
  81. gen_thrift/common/ttypes.py +1814 -0
  82. gen_thrift/eval/__init__.py +1 -0
  83. gen_thrift/eval/constants.py +15 -0
  84. gen_thrift/eval/ttypes.py +660 -0
  85. gen_thrift/fetcher/__init__.py +1 -0
  86. gen_thrift/fetcher/constants.py +15 -0
  87. gen_thrift/fetcher/ttypes.py +127 -0
  88. gen_thrift/hub/__init__.py +1 -0
  89. gen_thrift/hub/constants.py +15 -0
  90. gen_thrift/hub/ttypes.py +1109 -0
  91. gen_thrift/observability/__init__.py +1 -0
  92. gen_thrift/observability/constants.py +15 -0
  93. gen_thrift/observability/ttypes.py +2355 -0
  94. gen_thrift/planner/__init__.py +1 -0
  95. gen_thrift/planner/constants.py +15 -0
  96. gen_thrift/planner/ttypes.py +1967 -0
@@ -0,0 +1,164 @@
1
+ from enum import Enum
2
+
3
+
4
+ class RunMode(str, Enum):
5
+ def __str__(self):
6
+ return self.value
7
+
8
+ BACKFILL = "backfill"
9
+ BACKFILL_LEFT = "backfill-left"
10
+ BACKFILL_FINAL = "backfill-final"
11
+ DEPLOY = "deploy"
12
+ UPLOAD = "upload"
13
+ UPLOAD_TO_KV = "upload-to-kv"
14
+ STATS_SUMMARY = "stats-summary"
15
+ LOG_SUMMARY = "log-summary"
16
+ ANALYZE = "analyze"
17
+ STREAMING = "streaming"
18
+ METADATA_UPLOAD = "metadata-upload"
19
+ FETCH = "fetch"
20
+ CONSISTENCY_METRICS_COMPUTE = "consistency-metrics-compute"
21
+ BUILD_COMPARISON_TABLE = "build-comparison-table"
22
+ COMPARE = "compare"
23
+ LOCAL_STREAMING = "local-streaming"
24
+ LOG_FLATTENER = "log-flattener"
25
+ METADATA_EXPORT = "metadata-export"
26
+ LABEL_JOIN = "label-join"
27
+ STREAMING_CLIENT = "streaming-client"
28
+ SOURCE_JOB = "source-job"
29
+ JOIN_PART_JOB = "join-part-job"
30
+ MERGE_JOB = "merge-job"
31
+ METASTORE = "metastore"
32
+ INFO = "info"
33
+
34
+
35
+ ONLINE_ARGS = "--online-jar={online_jar} --online-class={online_class} "
36
+ OFFLINE_ARGS = "--conf-path={conf_path} --end-date={ds} "
37
+ ONLINE_WRITE_ARGS = "--conf-path={conf_path} " + ONLINE_ARGS
38
+
39
+ ONLINE_OFFLINE_WRITE_ARGS = OFFLINE_ARGS + ONLINE_ARGS
40
+ ONLINE_MODES = [
41
+ RunMode.STREAMING,
42
+ RunMode.METADATA_UPLOAD,
43
+ RunMode.FETCH,
44
+ RunMode.LOCAL_STREAMING,
45
+ RunMode.STREAMING_CLIENT,
46
+ ]
47
+ SPARK_MODES = [
48
+ RunMode.BACKFILL,
49
+ RunMode.BACKFILL_LEFT,
50
+ RunMode.BACKFILL_FINAL,
51
+ RunMode.UPLOAD,
52
+ RunMode.UPLOAD_TO_KV,
53
+ RunMode.STREAMING,
54
+ RunMode.STREAMING_CLIENT,
55
+ RunMode.CONSISTENCY_METRICS_COMPUTE,
56
+ RunMode.BUILD_COMPARISON_TABLE,
57
+ RunMode.COMPARE,
58
+ RunMode.ANALYZE,
59
+ RunMode.STATS_SUMMARY,
60
+ RunMode.LOG_SUMMARY,
61
+ RunMode.LOG_FLATTENER,
62
+ RunMode.METADATA_EXPORT,
63
+ RunMode.LABEL_JOIN,
64
+ RunMode.SOURCE_JOB,
65
+ RunMode.JOIN_PART_JOB,
66
+ RunMode.MERGE_JOB,
67
+ ]
68
+ MODES_USING_EMBEDDED = [
69
+ RunMode.METADATA_UPLOAD,
70
+ RunMode.FETCH,
71
+ RunMode.LOCAL_STREAMING,
72
+ ]
73
+
74
+ # Constants for supporting multiple spark versions.
75
+ SUPPORTED_SPARK = ["2.4.0", "3.1.1", "3.2.1", "3.5.1"]
76
+ SCALA_VERSION_FOR_SPARK = {
77
+ "2.4.0": "2.11",
78
+ "3.1.1": "2.12",
79
+ "3.2.1": "2.13",
80
+ "3.5.1": "2.12",
81
+ }
82
+
83
+ MODE_ARGS = {
84
+ RunMode.BACKFILL: OFFLINE_ARGS,
85
+ RunMode.BACKFILL_LEFT: OFFLINE_ARGS,
86
+ RunMode.BACKFILL_FINAL: OFFLINE_ARGS,
87
+ RunMode.UPLOAD: OFFLINE_ARGS,
88
+ RunMode.UPLOAD_TO_KV: ONLINE_OFFLINE_WRITE_ARGS,
89
+ RunMode.STATS_SUMMARY: OFFLINE_ARGS,
90
+ RunMode.LOG_SUMMARY: OFFLINE_ARGS,
91
+ RunMode.ANALYZE: OFFLINE_ARGS,
92
+ RunMode.STREAMING: ONLINE_WRITE_ARGS,
93
+ RunMode.METADATA_UPLOAD: ONLINE_WRITE_ARGS,
94
+ RunMode.FETCH: ONLINE_ARGS,
95
+ RunMode.CONSISTENCY_METRICS_COMPUTE: OFFLINE_ARGS,
96
+ RunMode.BUILD_COMPARISON_TABLE: OFFLINE_ARGS,
97
+ RunMode.COMPARE: OFFLINE_ARGS,
98
+ RunMode.LOCAL_STREAMING: ONLINE_WRITE_ARGS + " -d",
99
+ RunMode.LOG_FLATTENER: OFFLINE_ARGS,
100
+ RunMode.METADATA_EXPORT: OFFLINE_ARGS,
101
+ RunMode.LABEL_JOIN: OFFLINE_ARGS,
102
+ RunMode.STREAMING_CLIENT: ONLINE_WRITE_ARGS,
103
+ RunMode.SOURCE_JOB: OFFLINE_ARGS,
104
+ RunMode.JOIN_PART_JOB: OFFLINE_ARGS,
105
+ RunMode.MERGE_JOB: OFFLINE_ARGS,
106
+ RunMode.METASTORE: "", # purposely left blank. we'll handle this specifically
107
+ RunMode.INFO: "",
108
+ }
109
+
110
+ ROUTES = {
111
+ "group_bys": {
112
+ RunMode.UPLOAD: "group-by-upload",
113
+ RunMode.UPLOAD_TO_KV: "group-by-upload-bulk-load",
114
+ RunMode.BACKFILL: "group-by-backfill",
115
+ RunMode.STREAMING: "group-by-streaming",
116
+ RunMode.METADATA_UPLOAD: "metadata-upload",
117
+ RunMode.LOCAL_STREAMING: "group-by-streaming",
118
+ RunMode.FETCH: "fetch",
119
+ RunMode.ANALYZE: "analyze",
120
+ RunMode.METADATA_EXPORT: "metadata-export",
121
+ RunMode.STREAMING_CLIENT: "group-by-streaming",
122
+ },
123
+ "joins": {
124
+ RunMode.BACKFILL: "join",
125
+ RunMode.BACKFILL_LEFT: "join-left",
126
+ RunMode.BACKFILL_FINAL: "join-final",
127
+ RunMode.METADATA_UPLOAD: "metadata-upload",
128
+ RunMode.FETCH: "fetch",
129
+ RunMode.CONSISTENCY_METRICS_COMPUTE: "consistency-metrics-compute",
130
+ RunMode.BUILD_COMPARISON_TABLE: "build-comparison-table",
131
+ RunMode.COMPARE: "compare-join-query",
132
+ RunMode.STATS_SUMMARY: "stats-summary",
133
+ RunMode.LOG_SUMMARY: "log-summary",
134
+ RunMode.ANALYZE: "analyze",
135
+ RunMode.LOG_FLATTENER: "log-flattener",
136
+ RunMode.METADATA_EXPORT: "metadata-export",
137
+ RunMode.LABEL_JOIN: "label-join",
138
+ RunMode.SOURCE_JOB: "source-job",
139
+ RunMode.JOIN_PART_JOB: "join-part-job",
140
+ RunMode.MERGE_JOB: "merge-job",
141
+ },
142
+ "staging_queries": {
143
+ RunMode.BACKFILL: "staging-query-backfill",
144
+ RunMode.METADATA_EXPORT: "metadata-export",
145
+ },
146
+ }
147
+
148
+ UNIVERSAL_ROUTES = ["info"]
149
+
150
+ APP_NAME_TEMPLATE = "chronon_{conf_type}_{mode}_{context}_{name}"
151
+ RENDER_INFO_DEFAULT_SCRIPT = "scripts/render_info.py"
152
+
153
+ ZIPLINE_DIRECTORY = "/tmp/zipline"
154
+
155
+ CLOUD_PROVIDER_KEYWORD = "CLOUD_PROVIDER"
156
+
157
+ # cloud provider
158
+ AWS = "AWS"
159
+ GCP = "GCP"
160
+
161
+ # arg keywords
162
+ ONLINE_CLASS_ARG = "online_class"
163
+ ONLINE_JAR_ARG = "online_jar"
164
+ ONLINE_ARGS = "online_args"
@@ -0,0 +1,269 @@
1
+ import json
2
+ import logging
3
+ import multiprocessing
4
+ import os
5
+
6
+ from ai.chronon.repo import utils
7
+ from ai.chronon.repo.constants import (
8
+ MODE_ARGS,
9
+ ONLINE_ARGS,
10
+ ONLINE_CLASS_ARG,
11
+ ONLINE_JAR_ARG,
12
+ ONLINE_MODES,
13
+ ROUTES,
14
+ SPARK_MODES,
15
+ UNIVERSAL_ROUTES,
16
+ RunMode,
17
+ )
18
+
19
+
20
+ class Runner:
21
+ def __init__(self, args, jar_path):
22
+ self.repo = args["repo"]
23
+ self.conf = args["conf"]
24
+ self.local_abs_conf_path = os.path.realpath(os.path.join(self.repo, self.conf))
25
+ self.sub_help = args["sub_help"]
26
+ self.mode = args["mode"]
27
+ self.online_jar = args.get(ONLINE_JAR_ARG)
28
+ self.online_class = args.get(ONLINE_CLASS_ARG)
29
+ self.online_args = args.get(ONLINE_ARGS)
30
+
31
+ self.conf_type = (args.get("conf_type") or "").replace(
32
+ "-", "_"
33
+ ) # in case user sets dash instead of underscore
34
+
35
+ # streaming flink
36
+ self.conf_metadata_name = utils.get_metadata_name_from_conf(self.repo, self.conf)
37
+ self.kafka_bootstrap = args.get("kafka_bootstrap")
38
+ self.latest_savepoint = args.get("latest_savepoint")
39
+ self.custom_savepoint = args.get("custom_savepoint")
40
+ self.no_savepoint = args.get("no_savepoint")
41
+ self.version_check = args.get("version_check")
42
+ self.additional_jars = args.get("additional_jars")
43
+
44
+ flink_state_uri = args.get("flink_state_uri")
45
+ if flink_state_uri:
46
+ self.streaming_manifest_path = os.path.join(flink_state_uri, "manifests")
47
+ self.streaming_checkpoint_path = os.path.join(flink_state_uri, "checkpoints")
48
+
49
+ self.mock_source = args.get("mock_source")
50
+
51
+ self.validate = args.get("validate")
52
+ self.validate_rows = args.get("validate_rows")
53
+ self.enable_debug = args.get("enable_debug")
54
+ self.uploader = args.get("uploader")
55
+
56
+ valid_jar = args["online_jar"] and os.path.exists(args["online_jar"])
57
+
58
+ # fetch online jar if necessary
59
+ if (
60
+ (self.mode in ONLINE_MODES)
61
+ and (not args["sub_help"])
62
+ and not valid_jar
63
+ and (args.get("online_jar_fetch"))
64
+ ):
65
+ print("Downloading online_jar")
66
+ self.online_jar = utils.check_output("{}".format(args["online_jar_fetch"])).decode(
67
+ "utf-8"
68
+ )
69
+ os.environ["CHRONON_ONLINE_JAR"] = self.online_jar
70
+ print("Downloaded jar to {}".format(self.online_jar))
71
+
72
+ if self.conf and (self.mode != "metastore"): # TODO: don't check for metastore
73
+ try:
74
+ self.context, self.conf_type, self.team, _ = self.conf.split("/")[-4:]
75
+ except Exception as e:
76
+ logging.error(
77
+ "Invalid conf path: {}, please ensure to supply the relative path to zipline/ folder".format(
78
+ self.conf
79
+ )
80
+ )
81
+ raise e
82
+ possible_modes = list(ROUTES[self.conf_type].keys()) + UNIVERSAL_ROUTES
83
+ assert args["mode"] in possible_modes, (
84
+ "Invalid mode:{} for conf:{} of type:{}, please choose from {}".format(
85
+ args["mode"], self.conf, self.conf_type, possible_modes
86
+ )
87
+ )
88
+
89
+ self.ds = args["end_ds"] if "end_ds" in args and args["end_ds"] else args["ds"]
90
+ self.start_ds = args["start_ds"] if "start_ds" in args and args["start_ds"] else None
91
+ self.parallelism = (
92
+ int(args["parallelism"]) if "parallelism" in args and args["parallelism"] else 1
93
+ )
94
+ self.jar_path = jar_path
95
+
96
+ self.args = args["args"] if args["args"] else ""
97
+ self.app_name = args["app_name"]
98
+ if self.mode == "streaming":
99
+ self.spark_submit = args["spark_streaming_submit_path"]
100
+ elif self.mode == "info":
101
+ assert os.path.exists(args["render_info"]), (
102
+ "Invalid path for the render info script: {}".format(args["render_info"])
103
+ )
104
+ self.render_info = args["render_info"]
105
+ else:
106
+ self.spark_submit = args["spark_submit_path"]
107
+ self.list_apps_cmd = args["list_apps"]
108
+
109
+ self.disable_cloud_logging = args.get("disable_cloud_logging")
110
+
111
+ def run_spark_streaming(self):
112
+ # streaming mode
113
+ self.app_name = self.app_name.replace(
114
+ "_streaming-client_", "_streaming_"
115
+ ) # If the job is running cluster mode we want to kill it.
116
+ print(
117
+ "Checking to see if a streaming job by the name {} already exists".format(self.app_name)
118
+ )
119
+ running_apps = (
120
+ utils.check_output("{}".format(self.list_apps_cmd)).decode("utf-8").split("\n")
121
+ )
122
+ running_app_map = {}
123
+ for app in running_apps:
124
+ try:
125
+ app_json = json.loads(app.strip())
126
+ app_name = app_json["app_name"].strip()
127
+ if app_name not in running_app_map:
128
+ running_app_map[app_name] = []
129
+ running_app_map[app_name].append(app_json)
130
+ except Exception as ex:
131
+ print("failed to process line into app: " + app)
132
+ print(ex)
133
+
134
+ filtered_apps = running_app_map.get(self.app_name, [])
135
+ if len(filtered_apps) > 0:
136
+ print(
137
+ "Found running apps by the name {} in \n{}\n".format(
138
+ self.app_name,
139
+ "\n".join([str(app) for app in filtered_apps]),
140
+ )
141
+ )
142
+ if self.mode == "streaming":
143
+ assert len(filtered_apps) == 1, "More than one found, please kill them all"
144
+ print("All good. No need to start a new app.")
145
+ return
146
+ elif self.mode == "streaming-client":
147
+ raise RuntimeError(
148
+ "Attempting to submit an application in client mode, but there's already"
149
+ " an existing one running."
150
+ )
151
+ command = (
152
+ "bash {script} --class ai.chronon.spark.Driver {jar} {subcommand} {args} {additional_args}"
153
+ ).format(
154
+ script=self.spark_submit,
155
+ jar=self.jar_path,
156
+ subcommand=ROUTES[self.conf_type][self.mode],
157
+ args=self._gen_final_args(),
158
+ additional_args=os.environ.get("CHRONON_CONFIG_ADDITIONAL_ARGS", ""),
159
+ )
160
+ return command
161
+
162
+ def run(self):
163
+ command_list = []
164
+ if self.mode == "info":
165
+ command_list.append(
166
+ "python3 {script} --conf {conf} --ds {ds} --repo {repo}".format(
167
+ script=self.render_info, conf=self.conf, ds=self.ds, repo=self.repo
168
+ )
169
+ )
170
+ elif self.sub_help or (self.mode not in SPARK_MODES):
171
+ if self.mode == "fetch":
172
+ entrypoint = "ai.chronon.online.fetcher.FetcherMain"
173
+ else:
174
+ entrypoint = "ai.chronon.spark.Driver"
175
+ command_list.append(
176
+ "java -cp {jar} {entrypoint} {subcommand} {args}".format(
177
+ jar=self.jar_path,
178
+ entrypoint=entrypoint,
179
+ args="--help" if self.sub_help else self._gen_final_args(),
180
+ subcommand=ROUTES[self.conf_type][self.mode],
181
+ )
182
+ )
183
+ else:
184
+ if self.mode in ["streaming", "streaming-client"]:
185
+ # streaming mode
186
+ command = self.run_spark_streaming()
187
+ command_list.append(command)
188
+ else:
189
+ if self.parallelism > 1:
190
+ assert self.start_ds is not None and self.ds is not None, (
191
+ "To use parallelism, please specify --start-ds and --end-ds to "
192
+ "break down into multiple backfill jobs"
193
+ )
194
+ date_ranges = utils.split_date_range(self.start_ds, self.ds, self.parallelism)
195
+ for start_ds, end_ds in date_ranges:
196
+ command = (
197
+ "bash {script} --class ai.chronon.spark.Driver "
198
+ + "{jar} {subcommand} {args} {additional_args}"
199
+ ).format(
200
+ script=self.spark_submit,
201
+ jar=self.jar_path,
202
+ subcommand=ROUTES[self.conf_type][self.mode],
203
+ args=self._gen_final_args(start_ds=start_ds, end_ds=end_ds),
204
+ additional_args=os.environ.get("CHRONON_CONFIG_ADDITIONAL_ARGS", ""),
205
+ )
206
+ command_list.append(command)
207
+ else:
208
+ command = (
209
+ "bash {script} --class ai.chronon.spark.Driver "
210
+ + "{jar} {subcommand} {args} {additional_args}"
211
+ ).format(
212
+ script=self.spark_submit,
213
+ jar=self.jar_path,
214
+ subcommand=ROUTES[self.conf_type][self.mode],
215
+ args=self._gen_final_args(self.start_ds),
216
+ additional_args=os.environ.get("CHRONON_CONFIG_ADDITIONAL_ARGS", ""),
217
+ )
218
+ command_list.append(command)
219
+
220
+ if len(command_list) > 1:
221
+ # parallel backfill mode
222
+ with multiprocessing.Pool(processes=int(self.parallelism)) as pool:
223
+ logging.info(
224
+ "Running args list {} with pool size {}".format(command_list, self.parallelism)
225
+ )
226
+ pool.map(utils.check_call, command_list)
227
+ elif len(command_list) == 1:
228
+ utils.check_call(command_list[0])
229
+
230
+ def _gen_final_args(self, start_ds=None, end_ds=None, override_conf_path=None, **kwargs):
231
+ base_args = MODE_ARGS.get(self.mode).format(
232
+ conf_path=override_conf_path if override_conf_path else self.conf,
233
+ ds=end_ds if end_ds else self.ds,
234
+ online_jar=self.online_jar,
235
+ online_class=self.online_class,
236
+ )
237
+
238
+ submitter_args = []
239
+
240
+ if self.conf_type:
241
+ submitter_args.append(f"--conf-type={self.conf_type}")
242
+
243
+ if self.uploader:
244
+ submitter_args.append(f"--uploader={self.uploader}")
245
+
246
+ if self.additional_jars:
247
+ submitter_args.append(f"--additional-jars={self.additional_jars}")
248
+
249
+ if self.mode != RunMode.FETCH:
250
+ submitter_args.append(" --local-conf-path={conf}".format(conf=self.local_abs_conf_path))
251
+ submitter_args.append(" --original-mode={mode}".format(mode=self.mode))
252
+
253
+ override_start_partition_arg = "--start-partition-override=" + start_ds if start_ds else ""
254
+
255
+ additional_args = " ".join(
256
+ f"--{key.replace('_', '-')}={value}" for key, value in kwargs.items() if value
257
+ )
258
+
259
+ final_args = " ".join(
260
+ [
261
+ base_args,
262
+ str(self.args),
263
+ override_start_partition_arg,
264
+ " ".join(submitter_args),
265
+ additional_args,
266
+ ]
267
+ )
268
+
269
+ return final_args