Spaces:
Running
Running
Download src/backend/base/langflow/utils/connection_string_parser.py from opendigital/agent-flow: direct link, hf CLI and curl.
- Browser
- Download file 325 Bytes
-
https://huggingface.co/spaces/opendigital/agent-flow/resolve/main/src/backend/base/langflow/utils/connection_string_parser.py
- Command line
-
hf download hf://spaces/opendigital/agent-flow/src/backend/base/langflow/utils/connection_string_parser.py
-
curl -L -o connection_string_parser.py https://huggingface.co/spaces/opendigital/agent-flow/resolve/main/src/backend/base/langflow/utils/connection_string_parser.py
325 Bytes
| from urllib.parse import quote | |
| def transform_connection_string(connection_string) -> str: | |
| auth_part, db_url_name = connection_string.rsplit("@", 1) | |
| protocol_user, password_string = auth_part.rsplit(":", 1) | |
| encoded_password = quote(password_string) | |
| return f"{protocol_user}:{encoded_password}@{db_url_name}" | |