Skip to content

Commit 1b339b2

Browse files
authored
fix: specifying a target version for a source does not actually install that version (airbytehq#651)
1 parent ee5cb2d commit 1b339b2

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

airbyte/_executors/util.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def _get_local_executor(
124124
)
125125

126126

127-
def get_connector_executor( # noqa: PLR0912, PLR0913, PLR0915 # Too many branches/arguments/statements
127+
def get_connector_executor( # noqa: PLR0912, PLR0913, PLR0915, C901 # Too many branches/arguments/statements
128128
name: str,
129129
*,
130130
version: str | None = None,
@@ -148,6 +148,19 @@ def get_connector_executor( # noqa: PLR0912, PLR0913, PLR0915 # Too many branch
148148
bool(source_manifest),
149149
]
150150
)
151+
152+
if version and pip_url:
153+
raise exc.PyAirbyteInputError(
154+
message=(
155+
"Cannot specify both version and pip_url. "
156+
"Make sure to specify the connector version directly in the pip_url."
157+
),
158+
context={
159+
"version": version,
160+
"pip_url": pip_url,
161+
},
162+
)
163+
151164
if install_method_count > 1:
152165
raise exc.PyAirbyteInputError(
153166
message=(
@@ -198,6 +211,7 @@ def get_connector_executor( # noqa: PLR0912, PLR0913, PLR0915 # Too many branch
198211
source_manifest = True
199212
case InstallType.PYTHON:
200213
pip_url = metadata.pypi_package_name
214+
pip_url = f"{pip_url}=={version}" if version else pip_url
201215
case _:
202216
docker_image = True
203217

0 commit comments

Comments
 (0)