From dd9ff01e0b378fd82774a1730c603ead4753ad89 Mon Sep 17 00:00:00 2001 From: Marc Jessome Date: Thu, 12 Dec 2024 11:59:13 -0500 Subject: [PATCH] Add limit to AplOptions (#5) --- src/axiom_py/client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/axiom_py/client.py b/src/axiom_py/client.py index b11663f..a144d8d 100644 --- a/src/axiom_py/client.py +++ b/src/axiom_py/client.py @@ -110,6 +110,8 @@ class AplOptions: # IncludeCursor will return the Cursor as part of the query result, if set # to true. includeCursor: bool = field(default=False) + # The query limit. + limit: Optional[int] = field(default=None) class AxiomError(Exception): @@ -368,11 +370,13 @@ def _prepare_apl_options( self, opts: Optional[AplOptions] ) -> Dict[str, object]: """Prepare the apl query options for the request.""" - params = {"format": AplResultFormat.Legacy.value} + params: Dict[str, object] = {"format": AplResultFormat.Legacy.value} if opts is not None: if opts.format: params["format"] = opts.format.value + if opts.limit is not None: + params["request"] = {"limit": opts.limit} return params