@@ -120,48 +120,78 @@ def __init__(
120120 self ._url = url
121121 self ._date_columns : list [str ] = date_columns or []
122122
123- def get (self , * args : Any , ** kwargs : Any ) -> Union [pd .DataFrame , str ]:
123+ def get (
124+ self ,
125+ * args : Any ,
126+ filter : Optional [ODataPropertyFilter ] = None ,
127+ orderby : Optional [ODataPropertyOrderBy ] = None ,
128+ select : Optional [ODataProperty ] = None ,
129+ limit : Optional [int ] = None ,
130+ skip : Optional [int ] = None ,
131+ output : str = "dataframe" ,
132+ verbose : bool = False ,
133+ ** kwargs : Any ,
134+ ) -> Union [pd .DataFrame , str ]:
124135 """
125136 Executa a consulta na API OData e retorna o resultado.
126137
127138 Parameters
128139 ----------
129- *args : argumentos para a consulta
130-
131- **kwargs : argumentos para a consulta. Use ``output='text'`` to get
132- the raw OData JSON response string instead of a DataFrame.
140+ *args : argumentos para a consulta (ODataPropertyFilter, ODataPropertyOrderBy, ODataProperty)
141+ filter : ODataPropertyFilter, optional
142+ Filter condition for the query
143+ orderby : ODataPropertyOrderBy, optional
144+ Order by condition for the query
145+ select : ODataProperty, optional
146+ Properties to select from the query
147+ limit : int, optional
148+ Limit the number of results
149+ skip : int, optional
150+ Skip the first N results
151+ output : str, default "dataframe"
152+ Output format. Use ``'text'`` to get the raw OData JSON response
153+ string instead of a DataFrame.
154+ verbose : bool, default False
155+ Print the query before executing it
156+ **kwargs : argumentos adicionais para a consulta
133157
134158 Returns
135159 -------
136160 pd.DataFrame or str: resultado da consulta. Returns a DataFrame by
137161 default; returns a raw JSON string when ``output='text'``.
138162 """
139163 _query = EndpointQuery (self ._entity , self ._url , self ._date_columns )
164+
165+ # Apply explicit kwargs first
166+ if filter is not None :
167+ _query .filter (filter )
168+ if orderby is not None :
169+ _query .orderby (orderby )
170+ if select is not None :
171+ _query .select (select )
172+ if limit is not None :
173+ _query .limit (limit )
174+ if skip is not None :
175+ _query .skip (skip )
176+
177+ # Apply positional args for backwards compatibility
140178 for arg in args :
141179 if isinstance (arg , ODataPropertyFilter ):
142180 _query .filter (arg )
143181 elif isinstance (arg , ODataPropertyOrderBy ):
144182 _query .orderby (arg )
145183 elif isinstance (arg , ODataProperty ):
146184 _query .select (arg )
147- verbose = False
148- output_format = "dataframe"
185+
186+ # Apply any remaining kwargs as query parameters
149187 for k , val in kwargs .items ():
150- if k == "limit" :
151- _query .limit (val )
152- elif k == "skip" :
153- _query .skip (val )
154- elif k == "verbose" :
155- verbose = val
156- elif k == "output" :
157- output_format = val
158- else :
159- _query .parameters (** {k : val })
188+ _query .parameters (** {k : val })
189+
160190 _query .format ("application/json" )
161191
162192 if verbose :
163193 _query .show ()
164- if output_format == "text" :
194+ if output == "text" :
165195 data = _query .collect (output = "text" )
166196 else :
167197 data = _query .collect ()
0 commit comments