diff --git a/flame_hub/_base_client.py b/flame_hub/_base_client.py index 41f9494..6db1a35 100644 --- a/flame_hub/_base_client.py +++ b/flame_hub/_base_client.py @@ -365,7 +365,8 @@ def build_filter_params(filter_params: FilterParams | None = None) -> dict: query_params = {} for property_name, property_filter in filter_params.items(): - query_param_name = f"filter[{to_camel(property_name)}]" + property_name = ".".join(to_camel(p) for p in property_name.split(".")) + query_param_name = f"filter[{property_name}]" if not isinstance(property_filter, tuple): # t.Any -> (FilterOperator, t.Any) property_filter = (FilterOperator.eq, property_filter) diff --git a/tests/test_base_client.py b/tests/test_base_client.py index e085bc8..d7fb32e 100644 --- a/tests/test_base_client.py +++ b/tests/test_base_client.py @@ -64,6 +64,8 @@ def test_build_page_params(page_params, expected): ({"id": (">=", "20")}, {"filter[id]": ">=20"}), ({"display_name": ("=", "foo")}, {"filter[displayName]": "foo"}), ({"displayName": ("=", "bar")}, {"filter[displayName]": "bar"}), + ({"analysis.client_id": "foo"}, {"filter[analysis.clientId]": "foo"}), + ({"analysis.clientId": "bar"}, {"filter[analysis.clientId]": "bar"}), ], ) def test_build_filter_params(filter_params, expected):