diff --git a/sdks/python/pmxt/__init__.py b/sdks/python/pmxt/__init__.py index fe8cb554..d83070da 100644 --- a/sdks/python/pmxt/__init__.py +++ b/sdks/python/pmxt/__init__.py @@ -61,7 +61,9 @@ Position, Balance, MarketFilterCriteria, + MarketFilterFunction, EventFilterCriteria, + EventFilterFunction, MarketFetchParams, EventFetchParams, SeriesFetchParams, @@ -255,7 +257,9 @@ def restart_server() -> None: "FetchMatchedMarketClustersParams", "FetchMatchedEventClustersParams", "MarketFilterCriteria", + "MarketFilterFunction", "EventFilterCriteria", + "EventFilterFunction", "MarketFetchParams", "EventFetchParams", "SeriesFetchParams", diff --git a/sdks/python/tests/test_public_exports.py b/sdks/python/tests/test_public_exports.py index 79b5d604..75559b6e 100644 --- a/sdks/python/tests/test_public_exports.py +++ b/sdks/python/tests/test_public_exports.py @@ -30,6 +30,34 @@ def test_websocket_return_types_are_public_exports(): assert expected <= public_exports +def test_filter_function_types_are_public_exports(): + init_path = Path(__file__).resolve().parents[1] / "pmxt" / "__init__.py" + tree = ast.parse(init_path.read_text(encoding="utf-8")) + + imported_models = set() + public_exports = set() + + for node in tree.body: + if isinstance(node, ast.ImportFrom) and node.module == "models": + imported_models.update(alias.name for alias in node.names) + elif ( + isinstance(node, ast.Assign) + and len(node.targets) == 1 + and isinstance(node.targets[0], ast.Name) + and node.targets[0].id == "__all__" + and isinstance(node.value, ast.List) + ): + public_exports.update( + item.value + for item in node.value.elts + if isinstance(item, ast.Constant) and isinstance(item.value, str) + ) + + expected = {"MarketFilterFunction", "EventFilterFunction"} + assert expected <= imported_models + assert expected <= public_exports + + def test_fetch_order_book_params_shape_matches_typescript_sdk(): models_path = Path(__file__).resolve().parents[1] / "pmxt" / "models.py" tree = ast.parse(models_path.read_text(encoding="utf-8"))