@@ -177,6 +177,7 @@ def _resolve_source_job(
177
177
source : str | None = None ,
178
178
config : str | None = None ,
179
179
streams : str | None = None ,
180
+ pip_url : str | None = None ,
180
181
) -> Source :
181
182
"""Resolve the source job into a configured Source object.
182
183
@@ -187,6 +188,7 @@ def _resolve_source_job(
187
188
config: The path to a configuration file for the named source or destination.
188
189
streams: A comma-separated list of stream names to select for reading. If set to "*",
189
190
all streams will be selected. If not provided, all streams will be selected.
191
+ pip_url: Optional. A location from which to install the connector.
190
192
"""
191
193
config_dict = _resolve_config (config ) if config else None
192
194
streams_list : str | list [str ] = streams or "*"
@@ -200,6 +202,7 @@ def _resolve_source_job(
200
202
docker_image = source ,
201
203
config = config_dict ,
202
204
streams = streams_list ,
205
+ pip_url = pip_url ,
203
206
)
204
207
return source_obj
205
208
@@ -218,6 +221,7 @@ def _resolve_source_job(
218
221
local_executable = source_executable ,
219
222
config = config_dict ,
220
223
streams = streams_list ,
224
+ pip_url = pip_url ,
221
225
)
222
226
return source_obj
223
227
@@ -233,13 +237,15 @@ def _resolve_source_job(
233
237
name = source_name ,
234
238
config = config_dict ,
235
239
streams = streams_list ,
240
+ pip_url = pip_url ,
236
241
)
237
242
238
243
239
244
def _resolve_destination_job (
240
245
* ,
241
246
destination : str ,
242
247
config : str | None = None ,
248
+ pip_url : str | None = None ,
243
249
) -> Destination :
244
250
"""Resolve the destination job into a configured Destination object.
245
251
@@ -249,6 +255,7 @@ def _resolve_destination_job(
249
255
If the destination contains a colon (':'), it will be interpreted as a docker image
250
256
and tag.
251
257
config: The path to a configuration file for the named source or destination.
258
+ pip_url: Optional. A location from which to install the connector.
252
259
"""
253
260
if not config :
254
261
raise PyAirbyteInputError (
@@ -271,13 +278,15 @@ def _resolve_destination_job(
271
278
name = destination_executable .stem ,
272
279
local_executable = destination_executable ,
273
280
config = config_dict ,
281
+ pip_url = pip_url ,
274
282
)
275
283
276
284
# else: # Treat the destination as a name.
277
285
278
286
return get_destination (
279
287
name = destination ,
280
288
config = config_dict ,
289
+ pip_url = pip_url ,
281
290
)
282
291
283
292
@@ -293,6 +302,15 @@ def _resolve_destination_job(
293
302
type = str ,
294
303
help = "The connector name or a path to the local executable." ,
295
304
)
305
+ @click .option (
306
+ "--pip-url" ,
307
+ type = str ,
308
+ help = (
309
+ "Optional. The location from which to install the connector. "
310
+ "This can be a anything pip accepts, including: a PyPI package name, a local path, "
311
+ "a git repository, a git branch ref, etc."
312
+ ),
313
+ )
296
314
@click .option (
297
315
"--config" ,
298
316
type = str ,
@@ -302,6 +320,7 @@ def _resolve_destination_job(
302
320
def validate (
303
321
connector : str | None = None ,
304
322
config : str | None = None ,
323
+ pip_url : str | None = None ,
305
324
) -> None :
306
325
"""Validate the connector."""
307
326
if not connector :
@@ -315,11 +334,13 @@ def validate(
315
334
source = connector ,
316
335
config = None ,
317
336
streams = None ,
337
+ pip_url = pip_url ,
318
338
)
319
339
else : # destination
320
340
connector_obj = _resolve_destination_job (
321
341
destination = connector ,
322
342
config = None ,
343
+ pip_url = pip_url ,
323
344
)
324
345
325
346
print ("Getting `spec` output from connector..." )
0 commit comments