Build a clickhouse-driver client for the experimentation event store. The database is taken from the DSN path, so queries can reference the `events` table unqualified. Connect and query timeouts are bounded unless the DSN overrides them.
()
| 100 | |
| 101 | @lru_cache(maxsize=1) |
| 102 | def _get_clickhouse_client() -> Client: |
| 103 | """Build a clickhouse-driver client for the experimentation event store. |
| 104 | |
| 105 | The database is taken from the DSN path, so queries can reference the |
| 106 | `events` table unqualified. Connect and query timeouts are bounded unless the |
| 107 | DSN overrides them. |
| 108 | """ |
| 109 | host, kwargs = parse_url(settings.EXPERIMENTATION_CLICKHOUSE_URL) |
| 110 | kwargs.setdefault("connect_timeout", CLICKHOUSE_CONNECT_TIMEOUT_SECONDS) |
| 111 | kwargs.setdefault("send_receive_timeout", CLICKHOUSE_QUERY_TIMEOUT_SECONDS) |
| 112 | return Client(host, **kwargs) |
| 113 | |
| 114 | |
| 115 | def get_unique_event_names(environment_key: str) -> list[str]: |
no outgoing calls
no test coverage detected
searching dependent graphs…