meerschaum 2.2.7__py3-none-any.whl → 2.3.0.dev3__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 (52) hide show
  1. meerschaum/__init__.py +6 -1
  2. meerschaum/_internal/arguments/_parse_arguments.py +10 -3
  3. meerschaum/_internal/arguments/_parser.py +44 -15
  4. meerschaum/_internal/entry.py +22 -1
  5. meerschaum/_internal/shell/Shell.py +129 -31
  6. meerschaum/actions/__init__.py +8 -6
  7. meerschaum/actions/api.py +12 -12
  8. meerschaum/actions/attach.py +108 -0
  9. meerschaum/actions/delete.py +35 -26
  10. meerschaum/actions/show.py +119 -148
  11. meerschaum/actions/start.py +85 -75
  12. meerschaum/actions/stop.py +68 -39
  13. meerschaum/api/_events.py +18 -1
  14. meerschaum/api/_oauth2.py +2 -0
  15. meerschaum/api/_websockets.py +2 -2
  16. meerschaum/api/dash/jobs.py +5 -2
  17. meerschaum/api/routes/__init__.py +1 -0
  18. meerschaum/api/routes/_actions.py +122 -44
  19. meerschaum/api/routes/_jobs.py +371 -0
  20. meerschaum/api/routes/_pipes.py +5 -5
  21. meerschaum/config/_default.py +1 -0
  22. meerschaum/config/_paths.py +1 -0
  23. meerschaum/config/_shell.py +8 -3
  24. meerschaum/config/_version.py +1 -1
  25. meerschaum/config/static/__init__.py +10 -0
  26. meerschaum/connectors/__init__.py +9 -11
  27. meerschaum/connectors/api/APIConnector.py +18 -1
  28. meerschaum/connectors/api/_actions.py +60 -71
  29. meerschaum/connectors/api/_jobs.py +330 -0
  30. meerschaum/connectors/parse.py +23 -7
  31. meerschaum/plugins/__init__.py +89 -5
  32. meerschaum/utils/daemon/Daemon.py +255 -30
  33. meerschaum/utils/daemon/FileDescriptorInterceptor.py +5 -5
  34. meerschaum/utils/daemon/RotatingFile.py +10 -6
  35. meerschaum/utils/daemon/StdinFile.py +110 -0
  36. meerschaum/utils/daemon/__init__.py +13 -7
  37. meerschaum/utils/formatting/__init__.py +2 -1
  38. meerschaum/utils/formatting/_jobs.py +83 -54
  39. meerschaum/utils/formatting/_shell.py +6 -0
  40. meerschaum/utils/jobs/_Job.py +710 -0
  41. meerschaum/utils/jobs/__init__.py +245 -0
  42. meerschaum/utils/misc.py +18 -17
  43. meerschaum/utils/packages/_packages.py +2 -2
  44. meerschaum/utils/prompt.py +16 -8
  45. {meerschaum-2.2.7.dist-info → meerschaum-2.3.0.dev3.dist-info}/METADATA +9 -9
  46. {meerschaum-2.2.7.dist-info → meerschaum-2.3.0.dev3.dist-info}/RECORD +52 -46
  47. {meerschaum-2.2.7.dist-info → meerschaum-2.3.0.dev3.dist-info}/WHEEL +1 -1
  48. {meerschaum-2.2.7.dist-info → meerschaum-2.3.0.dev3.dist-info}/LICENSE +0 -0
  49. {meerschaum-2.2.7.dist-info → meerschaum-2.3.0.dev3.dist-info}/NOTICE +0 -0
  50. {meerschaum-2.2.7.dist-info → meerschaum-2.3.0.dev3.dist-info}/entry_points.txt +0 -0
  51. {meerschaum-2.2.7.dist-info → meerschaum-2.3.0.dev3.dist-info}/top_level.txt +0 -0
  52. {meerschaum-2.2.7.dist-info → meerschaum-2.3.0.dev3.dist-info}/zip-safe +0 -0
@@ -70,12 +70,12 @@ _loaded_plugin_connectors: bool = False
70
70
 
71
71
 
72
72
  def get_connector(
73
- type: str = None,
74
- label: str = None,
75
- refresh: bool = False,
76
- debug: bool = False,
77
- **kw: Any
78
- ) -> Connector:
73
+ type: str = None,
74
+ label: str = None,
75
+ refresh: bool = False,
76
+ debug: bool = False,
77
+ **kw: Any
78
+ ) -> Connector:
79
79
  """
80
80
  Return existing connector or create new connection and store for reuse.
81
81
 
@@ -274,9 +274,7 @@ def is_connected(keys: str, **kw) -> bool:
274
274
  return False
275
275
 
276
276
 
277
- def make_connector(
278
- cls,
279
- ):
277
+ def make_connector(cls):
280
278
  """
281
279
  Register a class as a `Connector`.
282
280
  The `type` will be the lower case of the class name, without the suffix `connector`.
@@ -338,8 +336,8 @@ def load_plugin_connectors():
338
336
 
339
337
 
340
338
  def get_connector_plugin(
341
- connector: Connector,
342
- ) -> Union[str, None, mrsm.Plugin]:
339
+ connector: Connector,
340
+ ) -> Union[str, None, mrsm.Plugin]:
343
341
  """
344
342
  Determine the plugin for a connector.
345
343
  This is useful for handling virtual environments for custom instance connectors.
@@ -33,7 +33,7 @@ class APIConnector(Connector):
33
33
  delete,
34
34
  wget,
35
35
  )
36
- from ._actions import get_actions, do_action
36
+ from ._actions import get_actions, do_action, do_action_async
37
37
  from ._misc import get_mrsm_version, get_chaining_status
38
38
  from ._pipes import (
39
39
  register_pipe,
@@ -72,6 +72,23 @@ class APIConnector(Connector):
72
72
  get_user_attributes,
73
73
  )
74
74
  from ._uri import from_uri
75
+ from ._jobs import (
76
+ get_jobs,
77
+ get_job,
78
+ get_job_metadata,
79
+ get_job_properties,
80
+ get_job_exists,
81
+ delete_job,
82
+ start_job,
83
+ create_job,
84
+ stop_job,
85
+ pause_job,
86
+ get_logs,
87
+ get_job_stop_time,
88
+ monitor_logs,
89
+ monitor_logs_async,
90
+ get_job_is_blocking_on_stdin,
91
+ )
75
92
 
76
93
  def __init__(
77
94
  self,
@@ -7,81 +7,70 @@ Functions to interact with /mrsm/actions
7
7
  """
8
8
 
9
9
  from __future__ import annotations
10
- from meerschaum.utils.typing import SuccessTuple, Optional, List
11
10
 
12
- def get_actions(self) -> list:
11
+ import json
12
+ import asyncio
13
+ from functools import partial
14
+
15
+ import meerschaum as mrsm
16
+ from meerschaum.utils.typing import SuccessTuple, List, Callable
17
+ from meerschaum.config.static import STATIC_CONFIG
18
+
19
+ ACTIONS_ENDPOINT: str = STATIC_CONFIG['api']['endpoints']['actions']
20
+
21
+
22
+ def get_actions(self):
13
23
  """Get available actions from the API instance."""
14
- from meerschaum.config.static import STATIC_CONFIG
15
- return self.get(STATIC_CONFIG['api']['endpoints']['actions'])
24
+ return self.get(ACTIONS_ENDPOINT)
25
+
26
+
27
+ def do_action(self, sysargs: List[str]) -> SuccessTuple:
28
+ """
29
+ Execute a Meerschaum action remotely.
30
+ """
31
+ return asyncio.run(self.do_action_async(sysargs))
16
32
 
17
33
 
18
- def do_action(
34
+ async def do_action_async(
19
35
  self,
20
- action: Optional[List[str]] = None,
21
- sysargs: Optional[List[str]] = None,
22
- debug: bool = False,
23
- **kw
36
+ sysargs: List[str],
37
+ callback_function: Callable[[str], None] = partial(print, end=''),
24
38
  ) -> SuccessTuple:
25
- """Execute a Meerschaum action remotely.
26
-
27
- If `sysargs` are provided, parse those instead.
28
- Otherwise infer everything from keyword arguments.
29
-
30
- Examples
31
- --------
32
- >>> conn = mrsm.get_connector('api:main')
33
- >>> conn.do_action(['show', 'pipes'])
34
- (True, "Success")
35
- >>> conn.do_action(['show', 'arguments'], name='test')
36
- (True, "Success")
37
39
  """
38
- import sys, json
39
- from meerschaum.utils.debug import dprint
40
- from meerschaum.config.static import STATIC_CONFIG
41
- from meerschaum.utils.misc import json_serialize_datetime
42
- if action is None:
43
- action = []
44
-
45
- if sysargs is not None and action and action[0] == '':
46
- from meerschaum._internal.arguments import parse_arguments
47
- if debug:
48
- dprint(f"Parsing sysargs:\n{sysargs}")
49
- json_dict = parse_arguments(sysargs)
50
- else:
51
- json_dict = kw
52
- json_dict['action'] = action
53
- if 'noask' not in kw:
54
- json_dict['noask'] = True
55
- if 'yes' not in kw:
56
- json_dict['yes'] = True
57
- if debug:
58
- json_dict['debug'] = debug
59
-
60
- root_action = json_dict['action'][0]
61
- del json_dict['action'][0]
62
- r_url = f"{STATIC_CONFIG['api']['endpoints']['actions']}/{root_action}"
63
-
64
- if debug:
65
- from meerschaum.utils.formatting import pprint
66
- dprint(f"Sending data to '{self.url + r_url}':")
67
- pprint(json_dict, stream=sys.stderr)
68
-
69
- response = self.post(
70
- r_url,
71
- data = json.dumps(json_dict, default=json_serialize_datetime),
72
- debug = debug,
73
- )
74
- try:
75
- response_list = json.loads(response.text)
76
- if isinstance(response_list, dict) and 'detail' in response_list:
77
- return False, response_list['detail']
78
- except Exception as e:
79
- print(f"Invalid response: {response}")
80
- print(e)
81
- return False, response.text
82
- if debug:
83
- dprint(response)
84
- try:
85
- return response_list[0], response_list[1]
86
- except Exception as e:
87
- return False, f"Failed to parse result from action '{root_action}'"
40
+ Monitor a job's log files and await a callback with the changes.
41
+ """
42
+ websockets, websockets_exceptions = mrsm.attempt_import('websockets', 'websockets.exceptions')
43
+ protocol = 'ws' if self.URI.startswith('http://') else 'wss'
44
+ port = self.port if 'port' in self.__dict__ else ''
45
+ uri = f"{protocol}://{self.host}:{port}{ACTIONS_ENDPOINT}/ws"
46
+ if sysargs and sysargs[0] == 'api' and len(sysargs) > 2:
47
+ sysargs = sysargs[2:]
48
+
49
+ sysargs_str = json.dumps(sysargs)
50
+
51
+ async with websockets.connect(uri) as websocket:
52
+ try:
53
+ await websocket.send(self.token or 'no-login')
54
+ response = await websocket.recv()
55
+ init_data = json.loads(response)
56
+ if not init_data.get('is_authenticated'):
57
+ return False, "Cannot authenticate with actions endpoint."
58
+
59
+ await websocket.send(sysargs_str)
60
+ except websockets_exceptions.ConnectionClosedOK:
61
+ return False, "Connection was closed."
62
+
63
+ while True:
64
+ try:
65
+ line = await websocket.recv()
66
+ if asyncio.iscoroutinefunction(callback_function):
67
+ await callback_function(line)
68
+ else:
69
+ callback_function(line)
70
+ except KeyboardInterrupt:
71
+ await websocket.close()
72
+ break
73
+ except websockets_exceptions.ConnectionClosedOK:
74
+ break
75
+
76
+ return True, "Success"
@@ -0,0 +1,330 @@
1
+ #! /usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ # vim:fenc=utf-8
4
+
5
+ """
6
+ Manage jobs via the Meerschaum API.
7
+ """
8
+
9
+ import asyncio
10
+ import time
11
+ import json
12
+ from datetime import datetime
13
+
14
+ import meerschaum as mrsm
15
+ from meerschaum.utils.typing import Dict, Any, SuccessTuple, List, Union, Callable
16
+ from meerschaum.utils.jobs import Job
17
+ from meerschaum.config.static import STATIC_CONFIG
18
+ from meerschaum.utils.warnings import warn, dprint
19
+
20
+ JOBS_ENDPOINT: str = STATIC_CONFIG['api']['endpoints']['jobs']
21
+ LOGS_ENDPOINT: str = STATIC_CONFIG['api']['endpoints']['logs']
22
+ JOBS_STDIN_MESSAGE: str = STATIC_CONFIG['api']['jobs']['stdin_message']
23
+ JOBS_STOP_MESSAGE: str = STATIC_CONFIG['api']['jobs']['stop_message']
24
+ JOB_METADATA_CACHE_SECONDS: int = STATIC_CONFIG['api']['jobs']['metadata_cache_seconds']
25
+
26
+
27
+ def get_jobs(self, debug: bool = False) -> Dict[str, Job]:
28
+ """
29
+ Return a dictionary of remote jobs.
30
+ """
31
+ response = self.get(JOBS_ENDPOINT, debug=debug)
32
+ if not response:
33
+ warn(f"Failed to get remote jobs from {self}.")
34
+ return {}
35
+ return {
36
+ name: Job(
37
+ name,
38
+ job_meta['sysargs'],
39
+ executor_keys=str(self),
40
+ _properties=job_meta['daemon']['properties']
41
+ )
42
+ for name, job_meta in response.json().items()
43
+ }
44
+
45
+
46
+ def get_job(self, name: str, debug: bool = False) -> Job:
47
+ """
48
+ Return a single Job object.
49
+ """
50
+ metadata = self.get_job_metadata(name, debug=debug)
51
+ if not metadata:
52
+ raise ValueError(f"Job '{name}' does not exist.")
53
+
54
+ return Job(
55
+ name,
56
+ metadata['sysargs'],
57
+ executor_keys=str(self),
58
+ _properties=metadata['daemon']['properties'],
59
+ )
60
+
61
+
62
+ def get_job_metadata(self, name: str, debug: bool = False) -> Dict[str, Any]:
63
+ """
64
+ Return the metadata for a single job.
65
+ """
66
+ now = time.perf_counter()
67
+ _job_metadata_cache = self.__dict__.get('_job_metadata_cache', None)
68
+ _job_metadata_timestamp = (
69
+ _job_metadata_cache.get(name, {}).get('timestamp', None)
70
+ ) if _job_metadata_cache is not None else None
71
+
72
+ if (
73
+ _job_metadata_timestamp is not None
74
+ and (now - _job_metadata_timestamp) < JOB_METADATA_CACHE_SECONDS
75
+ ):
76
+ if debug:
77
+ dprint(f"Returning cached metadata for job '{name}'.")
78
+ return _job_metadata_cache[name]['metadata']
79
+
80
+ response = self.get(JOBS_ENDPOINT + f"/{name}", debug=debug)
81
+ if not response:
82
+ if debug:
83
+ msg = (
84
+ response.json()['detail']
85
+ if 'detail' in response.text
86
+ else response.text
87
+ )
88
+ warn(f"Failed to get metadata for job '{name}':\n{msg}")
89
+ return {}
90
+
91
+ metadata = response.json()
92
+ if _job_metadata_cache is None:
93
+ self._job_metadata_cache = {}
94
+
95
+ self._job_metadata_cache[name] = {
96
+ 'timestamp': now,
97
+ 'metadata': metadata,
98
+ }
99
+ return metadata
100
+
101
+
102
+ def get_job_properties(self, name: str, debug: bool = False) -> Dict[str, Any]:
103
+ """
104
+ Return the daemon properties for a single job.
105
+ """
106
+ metadata = self.get_job_metadata(name, debug=debug)
107
+ return metadata.get('daemon', {}).get('properties', {})
108
+
109
+
110
+ def get_job_exists(self, name: str, debug: bool = False) -> bool:
111
+ """
112
+ Return whether a job exists.
113
+ """
114
+ response = self.get(JOBS_ENDPOINT + f'/{name}/exists', debug=debug)
115
+ if not response:
116
+ warn(f"Failed to determine whether job '{name}' exists.")
117
+ return False
118
+
119
+ return response.json()
120
+
121
+
122
+ def delete_job(self, name: str, debug: bool = False) -> SuccessTuple:
123
+ """
124
+ Delete a job.
125
+ """
126
+ response = self.delete(JOBS_ENDPOINT + f"/{name}", debug=debug)
127
+ if not response:
128
+ if 'detail' in response.text:
129
+ return False, response.json()['detail']
130
+
131
+ return False, response.text
132
+
133
+ return tuple(response.json())
134
+
135
+
136
+ def start_job(self, name: str, debug: bool = False) -> SuccessTuple:
137
+ """
138
+ Start a job.
139
+ """
140
+ response = self.post(JOBS_ENDPOINT + f"/{name}/start", debug=debug)
141
+ if not response:
142
+ if 'detail' in response.text:
143
+ return False, response.json()['detail']
144
+ return False, response.text
145
+
146
+ return tuple(response.json())
147
+
148
+
149
+ def create_job(self, name: str, sysargs: List[str], debug: bool = False) -> SuccessTuple:
150
+ """
151
+ Create a job.
152
+ """
153
+ response = self.post(JOBS_ENDPOINT + f"/{name}", json=sysargs, debug=debug)
154
+ if not response:
155
+ if 'detail' in response.text:
156
+ return False, response.json()['detail']
157
+ return False, response.text
158
+
159
+ return tuple(response.json())
160
+
161
+
162
+ def stop_job(self, name: str, debug: bool = False) -> SuccessTuple:
163
+ """
164
+ Stop a job.
165
+ """
166
+ response = self.post(JOBS_ENDPOINT + f"/{name}/stop", debug=debug)
167
+ if not response:
168
+ if 'detail' in response.text:
169
+ return False, response.json()['detail']
170
+ return False, response.text
171
+
172
+ return tuple(response.json())
173
+
174
+
175
+ def pause_job(self, name: str, debug: bool = False) -> SuccessTuple:
176
+ """
177
+ Pause a job.
178
+ """
179
+ response = self.post(JOBS_ENDPOINT + f"/{name}/pause", debug=debug)
180
+ if not response:
181
+ if 'detail' in response.text:
182
+ return False, response.json()['detail']
183
+ return False, response.text
184
+
185
+ return tuple(response.json())
186
+
187
+
188
+ def get_logs(self, name: str, debug: bool = False) -> str:
189
+ """
190
+ Return the logs for a job.
191
+ """
192
+ response = self.get(LOGS_ENDPOINT + f"/{name}")
193
+ if not response:
194
+ raise ValueError(f"Cannot fetch logs for job '{name}':\n{response.text}")
195
+
196
+ return response.json()
197
+
198
+
199
+ def get_job_stop_time(self, name: str, debug: bool = False) -> Union[datetime, None]:
200
+ """
201
+ Return the job's manual stop time.
202
+ """
203
+ response = self.get(JOBS_ENDPOINT + f"/{name}/stop_time")
204
+ if not response:
205
+ warn(f"Failed to get stop time for job '{name}':\n{response.text}")
206
+ return None
207
+
208
+ data = response.json()
209
+ if data is None:
210
+ return None
211
+
212
+ return datetime.fromisoformat(data)
213
+
214
+
215
+ async def monitor_logs_async(
216
+ self,
217
+ name: str,
218
+ callback_function: Callable[[Any], Any],
219
+ input_callback_function: Callable[[], str],
220
+ stop_callback_function: Callable[[SuccessTuple], str],
221
+ stop_on_exit: bool = False,
222
+ strip_timestamps: bool = False,
223
+ accept_input: bool = True,
224
+ debug: bool = False,
225
+ ):
226
+ """
227
+ Monitor a job's log files and await a callback with the changes.
228
+ """
229
+ from meerschaum.utils.jobs import StopMonitoringLogs
230
+ from meerschaum.utils.formatting._jobs import strip_timestamp_from_line
231
+
232
+ websockets, websockets_exceptions = mrsm.attempt_import('websockets', 'websockets.exceptions')
233
+ protocol = 'ws' if self.URI.startswith('http://') else 'wss'
234
+ port = self.port if 'port' in self.__dict__ else ''
235
+ uri = f"{protocol}://{self.host}:{port}{LOGS_ENDPOINT}/{name}/ws"
236
+
237
+ async def _stdin_callback(client):
238
+ if input_callback_function is None:
239
+ return
240
+
241
+ if asyncio.iscoroutinefunction(input_callback_function):
242
+ data = await input_callback_function()
243
+ else:
244
+ data = input_callback_function()
245
+
246
+ await client.send(data)
247
+
248
+ async def _stop_callback(client):
249
+ try:
250
+ result = tuple(json.loads(await client.recv()))
251
+ except Exception as e:
252
+ warn(traceback.format_exc())
253
+ result = False, str(e)
254
+
255
+ if stop_callback_function is not None:
256
+ if asyncio.iscoroutinefunction(stop_callback_function):
257
+ await stop_callback_function(result)
258
+ else:
259
+ stop_callback_function(result)
260
+
261
+ if stop_on_exit:
262
+ raise StopMonitoringLogs
263
+
264
+ message_callbacks = {
265
+ JOBS_STDIN_MESSAGE: _stdin_callback,
266
+ JOBS_STOP_MESSAGE: _stop_callback,
267
+ }
268
+
269
+ async with websockets.connect(uri) as websocket:
270
+ try:
271
+ await websocket.send(self.token or 'no-login')
272
+ except websockets_exceptions.ConnectionClosedOK:
273
+ pass
274
+
275
+ while True:
276
+ try:
277
+ response = await websocket.recv()
278
+ callback = message_callbacks.get(response, None)
279
+ if callback is not None:
280
+ await callback(websocket)
281
+ continue
282
+
283
+ if strip_timestamps:
284
+ response = strip_timestamp_from_line(response)
285
+
286
+ if asyncio.iscoroutinefunction(callback_function):
287
+ await callback_function(response)
288
+ else:
289
+ callback_function(response)
290
+ except (KeyboardInterrupt, StopMonitoringLogs):
291
+ await websocket.close()
292
+ break
293
+
294
+
295
+ def monitor_logs(
296
+ self,
297
+ name: str,
298
+ callback_function: Callable[[Any], Any],
299
+ input_callback_function: Callable[[None], str],
300
+ stop_callback_function: Callable[[None], str],
301
+ stop_on_exit: bool = False,
302
+ strip_timestamps: bool = False,
303
+ accept_input: bool = True,
304
+ debug: bool = False,
305
+ ):
306
+ """
307
+ Monitor a job's log files and execute a callback with the changes.
308
+ """
309
+ return asyncio.run(
310
+ self.monitor_logs_async(
311
+ name,
312
+ callback_function,
313
+ input_callback_function=input_callback_function,
314
+ stop_callback_function=stop_callback_function,
315
+ stop_on_exit=stop_on_exit,
316
+ strip_timestamps=strip_timestamps,
317
+ accept_input=accept_input,
318
+ debug=debug
319
+ )
320
+ )
321
+
322
+ def get_job_is_blocking_on_stdin(self, name: str, debug: bool = False) -> bool:
323
+ """
324
+ Return whether a remote job is blocking on stdin.
325
+ """
326
+ response = self.get(JOBS_ENDPOINT + f'/{name}/is_blocking_on_stdin', debug=debug)
327
+ if not response:
328
+ return False
329
+
330
+ return response.json()
@@ -10,11 +10,11 @@ from __future__ import annotations
10
10
  from meerschaum.utils.typing import Mapping, Any, SuccessTuple, Union, Optional, Dict, Tuple
11
11
 
12
12
  def parse_connector_keys(
13
- keys: str,
14
- construct: bool = True,
15
- as_tuple: bool = False,
16
- **kw: Any
17
- ) -> (
13
+ keys: str,
14
+ construct: bool = True,
15
+ as_tuple: bool = False,
16
+ **kw: Any
17
+ ) -> (
18
18
  Union[
19
19
  meerschaum.connectors.Connector,
20
20
  Dict[str, Any],
@@ -119,9 +119,25 @@ def parse_repo_keys(keys: Optional[str] = None, **kw):
119
119
  return parse_connector_keys(keys, **kw)
120
120
 
121
121
 
122
+ def parse_executor_keys(keys: Optional[str] = None, **kw):
123
+ """Parse the executor keys into an APIConnector or None."""
124
+ from meerschaum.config import get_config
125
+ if keys is None:
126
+ keys = get_config('meerschaum', 'default_executor')
127
+
128
+ if keys is None or keys == 'local':
129
+ return 'local'
130
+
131
+ keys = str(keys)
132
+ if ':' not in keys:
133
+ keys = 'api:' + keys
134
+
135
+ return parse_connector_keys(keys, **kw)
136
+
137
+
122
138
  def is_valid_connector_keys(
123
- keys: str
124
- ) -> bool:
139
+ keys: str
140
+ ) -> bool:
125
141
  """Verify a connector_keys string references a valid connector.
126
142
  """
127
143
  try: