@@ -36,6 +36,12 @@ def _kernel_host_and_path(
3636 the Thrift backend's direct-URI override) is split into its authority
3737 (returned as ``host``) and its path+query (returned as ``http_path``).
3838 ``_connection_uri`` wins over ``_port``, matching the Thrift backend.
39+ When the URI omits a path (e.g. ``https://host:8443`` or
40+ ``https://host:8443?o=222``) the connection's original ``http_path`` is
41+ retained, and any query on the URI is applied to that retained path — so
42+ a path-less, query-bearing URI overrides only the host and query while
43+ keeping the original warehouse path. The fragment (``#...``) is dropped
44+ since it never goes on the wire.
3945 - ``_port`` is otherwise folded into the host authority, unless the
4046 hostname already carries a port.
4147
@@ -58,6 +64,9 @@ def _kernel_host_and_path(
5864 "authority (expected scheme://host[:port]/path)" .format (connection_uri )
5965 )
6066 host = "{}://{}" .format (parts .scheme , parts .netloc )
67+ # A path-less URI keeps the connection's original http_path; any query
68+ # on the URI is then applied to that retained path (host + query
69+ # override, path preserved). See the docstring for the rationale.
6170 path = parts .path or http_path
6271 if parts .query :
6372 path = "{}?{}" .format (path , parts .query )
0 commit comments