{"record":{"id":"eb4363f57c056084","repo":"cocoindex-io/cocoindex","slug":"aiohttp-is-required-for-doris-connector-install-i","errorCode":null,"errorMessage":"aiohttp is required for Doris connector. Install it with: pip install aiohttp","messagePattern":"aiohttp is required for Doris connector\\. Install it with: pip install aiohttp","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"python/cocoindex/connectors/doris/_target.py","lineNumber":96,"sourceCode":"_RowFingerprint = bytes\nValueEncoder = Callable[[Any], Any]\nRowT = TypeVar(\"RowT\", default=dict[str, Any])\nT = TypeVar(\"T\")\n\n\n# ============================================================\n# Lazy imports\n# ============================================================\n\n\ndef _get_aiohttp() -> Any:\n    \"\"\"Lazily import aiohttp.\"\"\"\n    try:\n        import aiohttp  # type: ignore[import-not-found]\n\n        return aiohttp\n    except ImportError:\n        raise ImportError(\n            \"aiohttp is required for Doris connector. \"\n            \"Install it with: pip install aiohttp\"\n        )\n\n\ndef _get_pymysql() -> Any:\n    \"\"\"Lazily import pymysql (sync MySQL client for DDL).\"\"\"\n    try:\n        import pymysql  # type: ignore[import-not-found]\n\n        return pymysql\n    except ImportError:\n        raise ImportError(\n            \"pymysql is required for Doris connector DDL operations. \"\n            \"Install it with: pip install pymysql\"\n        )\n\n","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/cocoindex-io/cocoindex/blob/e84aa99b3292c5270a4b313b2a7137ad9ce8ab3b/python/cocoindex/connectors/doris/_target.py#L78-L114","documentation":"Raised by the Doris connector's lazy _get_aiohttp helper when aiohttp is not installed. aiohttp is required for Doris Stream Load (HTTP data ingestion); the connector defers the import and raises an actionable ImportError naming the pip package.","triggerScenarios":"Any Doris data-load operation (_stream_load) — and even retryability checks (_is_retryable_error) — in an environment without aiohttp.","commonSituations":"Base cocoindex install without the Doris extra; minimal Docker images; dependency pruning tools removing 'unused' aiohttp.","solutions":["Install aiohttp: `pip install aiohttp` (or the matching cocoindex extra).","Verify `python -c \"import aiohttp\"` works.","Add aiohttp to your project requirements so all environments include it."],"exampleFix":"// before\npip install cocoindex\n// after\npip install aiohttp  # or cocoindex[doris] if provided","handlingStrategy":"fallback","validationCode":"try:\n    import aiohttp  # noqa\nexcept ImportError:\n    raise SystemExit(\"Run: pip install aiohttp\")","typeGuard":null,"tryCatchPattern":"try:\n    app.update()\nexcept ImportError as e:\n    if \"aiohttp\" in str(e):\n        print(\"pip install aiohttp\")","preventionTips":["Install aiohttp (or the Doris extra) wherever loads run","Add an import smoke test to CI","Keep aiohttp pinned in requirements"],"tags":["doris","import-error","dependencies","http"],"backgroundTag":"missing-optional-dependency","analyzedSha":"e84aa99b3292c5270a4b313b2a7137ad9ce8ab3b","analyzedAt":"2026-09-08T15:59:19.997Z","contentChangedAt":"2026-09-08T15:59:19.997Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}