Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions airbyte/_executors/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def _try_get_source_manifest(

Raises:
- `PyAirbyteInputError`: If `source_name` is `None`.
- `HTTPError`: If fetching the URL was unsuccessful.
- `YAMLError`: If parsing the YAML failed.
- `AirbyteConnectorInstallationError`: If the registry file cannot be downloaded or if the
manifest YAML cannot be parsed.
"""
if source_name is None:
raise exc.PyAirbyteInputError(
Expand All @@ -62,7 +62,16 @@ def _try_get_source_manifest(
url=manifest_url,
headers={"User-Agent": f"PyAirbyte/{get_version()}"},
)
response.raise_for_status() # Raise HTTPError exception if the download failed
try:
response.raise_for_status() # Raise HTTPError exception if the download failed
except requests.exceptions.HTTPError as ex:
raise exc.AirbyteConnectorInstallationError(
message="Failed to download the connector manifest.",
context={
"manifest_url": manifest_url,
},
) from ex

try:
return cast("dict", yaml.safe_load(response.text))
except yaml.YAMLError as ex:
Expand Down
32 changes: 10 additions & 22 deletions airbyte/sources/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,13 @@
_REGISTRY_ENV_VAR = "AIRBYTE_LOCAL_REGISTRY"
_REGISTRY_URL = "https://connectors.airbyte.com/files/registries/v0/oss_registry.json"

_LOWCODE_CDK_TAG = "cdk:low-code"

_PYTHON_LANGUAGE = "python"
_MANIFEST_ONLY_LANGUAGE = "manifest-only"

_PYTHON_LANGUAGE_TAG = f"language:{_PYTHON_LANGUAGE}"
_MANIFEST_ONLY_TAG = f"language:{_MANIFEST_ONLY_LANGUAGE}"

_LOWCODE_CONNECTORS_NEEDING_PYTHON: list[str] = [
"source-adjust",
"source-alpha-vantage",
"source-amplitude",
"source-apify-dataset",
Expand All @@ -50,13 +47,14 @@
"source-braintree",
"source-braze",
"source-chargebee",
"source-close-com",
"source-commercetools",
"source-eventbrite",
"source-facebook-pages",
"source-fastbill",
"source-freshdesk",
"source-gitlab",
"source-gnews",
"source-gong",
"source-greenhouse",
"source-instagram",
"source-instatus",
Expand All @@ -74,7 +72,6 @@
"source-okta",
"source-orb",
"source-outreach",
"source-partnerstack",
"source-paypal-transaction",
"source-pinterest",
"source-pipedrive",
Expand All @@ -83,17 +80,17 @@
"source-prestashop",
"source-public-apis",
"source-qualaroo",
"source-quickbooks",
"source-railz",
"source-recharge",
"source-recurly",
"source-retently",
"source-rss",
"source-salesloft",
"source-service-now",
"source-slack",
"source-surveymonkey",
"source-tiktok-marketing",
"source-the-guardian-api",
"source-tiktok-marketing",
"source-trello",
"source-typeform",
"source-us-census",
Expand All @@ -106,21 +103,15 @@
"source-zenloop",
"source-zoom",
]
_LOWCODE_CONNECTORS_FAILING_VALIDATION = [
"source-amazon-ads",
]
_LOWCODE_CONNECTORS_FAILING_VALIDATION = []
# Connectors that return 404 or some other misc exception.
_LOWCODE_CONNECTORS_UNEXPECTED_ERRORS: list[str] = []
# (CDK) FileNotFoundError: Unable to find spec.yaml or spec.json in the package.
_LOWCODE_CDK_FILE_NOT_FOUND_ERRORS: list[str] = [
"source-apple-search-ads",
_LOWCODE_CONNECTORS_UNEXPECTED_ERRORS: list[str] = [
"source-adjust",
"source-amazon-ads",
"source-marketo",
"source-n8n",
"source-onesignal",
"source-postmarkapp",
"source-sentry",
"source-unleash",
]
# (CDK) FileNotFoundError: Unable to find spec.yaml or spec.json in the package.
_LOWCODE_CDK_FILE_NOT_FOUND_ERRORS: list[str] = []
_LOWCODE_CONNECTORS_EXCLUDED: list[str] = [
*_LOWCODE_CONNECTORS_FAILING_VALIDATION,
*_LOWCODE_CONNECTORS_UNEXPECTED_ERRORS,
Expand Down Expand Up @@ -219,9 +210,6 @@ def _registry_entry_to_connector_metadata(entry: dict) -> ConnectorMetadata:
InstallType.PYTHON if language == Language.PYTHON and pypi_enabled else None,
InstallType.JAVA if language == Language.JAVA else None,
InstallType.YAML if language == Language.MANIFEST_ONLY else None,
# TODO: Remove 'cdk:low-code' check once all connectors are migrated to manifest-only.
# https://github.com/airbytehq/PyAirbyte/issues/348
InstallType.YAML if _LOWCODE_CDK_TAG in tags else None,
]
if x
}
Expand Down
Loading
Loading