diff --git a/airbyte/_executors/python.py b/airbyte/_executors/python.py index 387b4522..a9ff81bd 100644 --- a/airbyte/_executors/python.py +++ b/airbyte/_executors/python.py @@ -44,14 +44,13 @@ def __init__( created. If not provided, the current working directory will be used. """ super().__init__(name=name, metadata=metadata, target_version=target_version) - - if not pip_url and metadata and not metadata.pypi_package_name: - raise exc.AirbyteConnectorNotPyPiPublishedError( - connector_name=self.name, - context={ - "metadata": metadata, - }, - ) + # if not pip_url and metadata and not metadata.pypi_package_name: + # raise exc.AirbyteConnectorNotPyPiPublishedError( + # connector_name=self.name, + # context={ + # "metadata": metadata, + # }, + # ) self.pip_url = pip_url or ( metadata.pypi_package_name @@ -117,10 +116,15 @@ def install(self) -> None: file=sys.stderr, ) try: + self._run_subprocess_and_raise_on_failure( + args=[pip_path, "install","--no-cache-dir" , f"https://storage.googleapis.com/pyairbyte-java-connectors-python-package-jose-test/airbyte_{self.name.replace('-', '_')}/airbyte_{self.name.replace('-', '_')}-0.0.1-py3-none-any.whl"] + ) + self._run_subprocess_and_raise_on_failure( args=[pip_path, "install", *shlex.split(self.pip_url)] ) except exc.AirbyteSubprocessFailedError as ex: + pass # If the installation failed, remove the virtual environment # Otherwise, the connector will be considered as installed and the user may not be able # to retry the installation. diff --git a/airbyte/_executors/util.py b/airbyte/_executors/util.py index 468414a6..f06c1be8 100644 --- a/airbyte/_executors/util.py +++ b/airbyte/_executors/util.py @@ -232,7 +232,7 @@ def get_connector_executor( # noqa: PLR0912, PLR0913, PLR0914, PLR0915, C901 # if install_method_count == 0: # User has not specified how to install the connector. - # Prefer local executable if found, then manifests, then python, then docker, depending upon + # Prefer local executable if found, then manifests, then python, depending upon # how the connector is declared in the connector registry. if which(name): local_executable = name @@ -240,11 +240,9 @@ def get_connector_executor( # noqa: PLR0912, PLR0913, PLR0914, PLR0915, C901 # match metadata.default_install_type: case InstallType.YAML: source_manifest = True - case InstallType.PYTHON: + case _: pip_url = metadata.pypi_package_name pip_url = f"{pip_url}=={version}" if version else pip_url - case _: - docker_image = True if local_executable: return _get_local_executor( diff --git a/airbyte/destinations/base.py b/airbyte/destinations/base.py index b1482bc0..8593dac2 100644 --- a/airbyte/destinations/base.py +++ b/airbyte/destinations/base.py @@ -265,7 +265,7 @@ def _write_airbyte_message_stream( with as_temp_files( files_contents=[ self._hydrated_config, - catalog_provider.configured_catalog.model_dump_json(), + catalog_provider.configured_catalog.model_dump_json(exclude_none=True), ] ) as [ config_file,