{"record":{"id":"2e55b2eeec7b70e7","repo":"pathwaycom/pathway","slug":"unrecognized-connector-mode-mode","errorCode":null,"errorMessage":"Unrecognized connector mode: {mode}","messagePattern":"Unrecognized connector mode: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/gdrive/__init__.py","lineNumber":593,"sourceCode":"            in processing at any moment. Reading pauses when the limit is reached and resumes\n            as processing of some entries completes. Useful with large sources that\n            emit an initial burst of data to avoid memory spikes.\n\n    Returns:\n        The table read.\n\n    Example:\n\n    >>> import pathway as pw\n    ...\n    >>> table = pw.io.gdrive.read(\n    ...     object_id=\"0BzDTMZY18pgfcGg4ZXFRTDFBX0j\",\n    ...     service_user_credentials_file=\"credentials.json\"\n    ... )\n    \"\"\"\n\n    if mode not in [\"streaming\", \"static\"]:\n        raise ValueError(f\"Unrecognized connector mode: {mode}\")\n\n    def credentials_factory() -> ServiceCredentials:\n        from google.oauth2.service_account import Credentials as ServiceCredentials\n\n        return ServiceCredentials.from_service_account_file(\n            fspath(service_user_credentials_file)\n        )\n\n    only_provide_metadata = format == \"only_metadata\"\n    subject = _GDriveSubject(\n        credentials_factory=credentials_factory,\n        root=object_id,\n        refresh_interval=as_duration_seconds(refresh_interval, \"refresh_interval\"),\n        mode=mode,\n        only_metadata=only_provide_metadata,\n        with_metadata=with_metadata or only_provide_metadata,\n        object_size_limit=object_size_limit,\n        file_name_pattern=file_name_pattern,","sourceCodeStart":575,"sourceCodeEnd":611,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/gdrive/__init__.py#L575-L611","documentation":"Raised by pw.io.gdrive.read when the `mode` argument is neither \"streaming\" nor \"static\". These are the only two connector modes: streaming re-polls the Drive folder for changes, static reads the objects once.","triggerScenarios":"pw.io.gdrive.read(object_id=..., service_user_credentials_file=..., mode=\"batch\") or mode=\"Static\" — anything other than the exact lowercase strings \"streaming\" or \"static\".","commonSituations":"Passing a mode from a config/env var with different casing or wording; copying mode values from other connectors (e.g. \"static_with_deletions\" or \"batch\") that have larger mode sets.","solutions":["Use mode=\"streaming\" (continuous re-reads) or mode=\"static\" (single read), exactly lowercase.","Normalize config-supplied modes: mode = config[\"mode\"].lower() and validate it is in {\"streaming\", \"static\"} before the call."],"exampleFix":"# before\npw.io.gdrive.read(object_id=obj, service_user_credentials_file=cred, mode=\"Static\")\n\n# after\npw.io.gdrive.read(object_id=obj, service_user_credentials_file=cred, mode=\"static\")","handlingStrategy":"validation","validationCode":"mode = mode.lower() if isinstance(mode, str) else mode\nassert mode in (\"streaming\", \"static\"), 'mode must be \"streaming\" or \"static\"'","typeGuard":"def is_valid_gdrive_mode(mode: str) -> bool:\n    return mode in (\"streaming\", \"static\")","tryCatchPattern":null,"preventionTips":["Normalize casing of config-driven mode strings before calling read().","Check each connector's accepted mode set; they differ between pathway connectors."],"tags":["gdrive","connector","api-misuse","validation"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}