{"record":{"id":"4ea4f511a4b7f44a","repo":"pola-rs/polars","slug":"a-non-https-workspace-url-was-given-workspace-ur","errorCode":null,"errorMessage":"a non-HTTPS workspace_url was given ({workspace_url}). To allow non-HTTPS URLs, pass require_https=False.","messagePattern":"a non-HTTPS workspace_url was given \\((.+?)\\)\\. To allow non-HTTPS URLs, pass require_https=False\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/catalog/unity/client.py","lineNumber":91,"sourceCode":"            URL of the workspace, or alternatively the URL of the Unity catalog\n            API endpoint.\n        bearer_token\n            Bearer token to authenticate with. This can also be set to:\n\n            * \"auto\": Automatically retrieve bearer tokens from the environment.\n            * \"databricks-sdk\": Use the Databricks SDK to retrieve and use the\n              bearer token from the environment.\n        require_https\n            Require the `workspace_url` to use HTTPS.\n        \"\"\"\n        issue_unstable_warning(\"`Catalog` functionality is considered unstable.\")\n\n        if require_https and not workspace_url.startswith(\"https://\"):\n            msg = (\n                f\"a non-HTTPS workspace_url was given ({workspace_url}). To \"\n                \"allow non-HTTPS URLs, pass require_https=False.\"\n            )\n            raise ValueError(msg)\n\n        if bearer_token == \"databricks-sdk\" or (\n            bearer_token == \"auto\"\n            # For security, in \"auto\" mode, only retrieve/use the token if:\n            # * We are running inside a Databricks environment\n            # * The `workspace_url` is pointing to Databricks and uses HTTPS\n            and \"DATABRICKS_RUNTIME_VERSION\" in os.environ\n            and workspace_url.startswith(\"https://\")\n            and (\n                workspace_url.removeprefix(\"https://\")\n                .split(\"/\", 1)[0]\n                .endswith(\".cloud.databricks.com\")\n            )\n        ):\n            bearer_token = self._get_databricks_token()\n\n        if bearer_token == \"auto\":\n            bearer_token = None","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/catalog/unity/client.py#L73-L109","documentation":"The Unity Catalog client raises ValueError when a workspace_url does not start with `https://` while HTTPS enforcement is on (require_https=True by default). This protects bearer tokens from being sent over plaintext connections. Callers can explicitly opt out with require_https=False, but that is discouraged for anything but local testing.","triggerScenarios":"Constructing `CatalogClient(...)` / Unity Catalog client with e.g. workspace_url=\"http://host:8080\" or \"localhost:8080\" while require_https is left at its default True.","commonSituations":"Pointing at a local Databricks emulator or dev server over http; forgetting the https:// scheme entirely; pasting an internal hostname without a scheme.","solutions":["Use an https:// workspace URL: workspace_url=\"https://dbc-xxxx.cloud.databricks.com\"","If intentionally testing against a local non-TLS server, pass require_https=False to the constructor","Add the scheme if it is missing: prefix the host with https://"],"exampleFix":"// before\nclient = CatalogClient(workspace_url=\"http://localhost:8080\", bearer_token=\"t\")\n// after\nclient = CatalogClient(workspace_url=\"https://dbc-xxxx.cloud.databricks.com\", bearer_token=tOKEN)\n# or, local dev only:\nclient = CatalogClient(workspace_url=\"http://localhost:8080\", bearer_token=\"t\", require_https=False)","handlingStrategy":"validation","validationCode":"if not workspace_url.startswith(\"https://\") and require_https:\n    raise ValueError(f\"workspace_url must use https://, got {workspace_url!r}\")","typeGuard":"def is_https_url(url: str) -> bool:\n    return url.startswith(\"https://\")","tryCatchPattern":"try:\n    client = CatalogClient(workspace_url=url, bearer_token=tok)\nexcept ValueError as e:\n    if \"non-HTTPS workspace_url\" in str(e):\n        client = CatalogClient(workspace_url=url, bearer_token=tok, require_https=False)  # dev only\n    else:\n        raise","preventionTips":["Always store full https:// URLs in config/env, never bare hostnames","Only pass require_https=False for throwaway local test servers","Validate config URLs at startup with a small assertion or pydantic validator"],"tags":["python","security","https","databricks"],"backgroundTag":"invalid-url-format","analyzedSha":"fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e","analyzedAt":"2026-09-18T22:14:11.667Z","contentChangedAt":"2026-09-18T22:14:11.667Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}