@@ -139,9 +139,9 @@ def __init__(
139139 reader delegates to :class:`SFCLIDataCloudReader` which calls
140140 the Data Cloud REST API directly using the token obtained from
141141 ``sf org display``, bypassing the CDP token-exchange flow.
142- default_row_limit: Default maximum number of rows to fetch when
143- ``row_limit`` is not explicitly passed to read methods. When
144- ``None``, no limit is applied (all rows are returned) .
142+ default_row_limit: Maximum number of rows to fetch automatically.
143+ When ``None``, no limit is applied (all rows are returned).
144+ Set via ``default_row_limit`` in ``config.yaml`` reader options .
145145 """
146146 self .spark = spark
147147 self ._default_row_limit = default_row_limit
@@ -165,37 +165,30 @@ def __init__(
165165 )
166166 self ._conn = create_cdp_connection (credentials , dataspace )
167167
168- def _build_query (self , name : str , row_limit : Optional [ int ] ) -> str :
169- """Build a SQL query, applying the default row limit when needed .
168+ def _build_query (self , name : str ) -> str :
169+ """Build a SQL query, applying the configured default row limit.
170170
171171 Args:
172172 name: Object name to query.
173- row_limit: Explicit row limit, or ``None`` to use the configured default.
174173
175174 Returns:
176175 SQL query string.
177176 """
178- effective_limit = (
179- row_limit if row_limit is not None else self ._default_row_limit
180- )
181- if effective_limit is not None :
182- return SQL_QUERY_TEMPLATE .format (name , effective_limit )
177+ if self ._default_row_limit is not None :
178+ return SQL_QUERY_TEMPLATE .format (name , self ._default_row_limit )
183179 return SQL_QUERY_TEMPLATE_NO_LIMIT .format (name )
184180
185181 def read_dlo (
186182 self ,
187183 name : str ,
188184 schema : Union [AtomicType , StructType , str , None ] = None ,
189- row_limit : Optional [int ] = None ,
190185 ) -> PySparkDataFrame :
191186 """
192187 Read a Data Lake Object (DLO) from the Data Cloud.
193188
194189 Args:
195190 name (str): The name of the DLO.
196191 schema (Optional[Union[AtomicType, StructType, str]]): Schema of the DLO.
197- row_limit (Optional[int]): Maximum number of rows to fetch.
198- When ``None``, the configured ``default_row_limit`` is used.
199192
200193 Returns:
201194 PySparkDataFrame: The PySpark DataFrame.
@@ -204,9 +197,9 @@ def read_dlo(
204197 self , "_sf_cli_reader" , None
205198 )
206199 if sf_cli_reader is not None :
207- return sf_cli_reader .read_dlo (name , schema , row_limit )
200+ return sf_cli_reader .read_dlo (name , schema )
208201
209- query = self ._build_query (name , row_limit )
202+ query = self ._build_query (name )
210203
211204 assert self ._conn is not None
212205 pandas_df = self ._conn .get_pandas_dataframe (query )
@@ -222,16 +215,13 @@ def read_dmo(
222215 self ,
223216 name : str ,
224217 schema : Union [AtomicType , StructType , str , None ] = None ,
225- row_limit : Optional [int ] = None ,
226218 ) -> PySparkDataFrame :
227219 """
228220 Read a Data Model Object (DMO) from the Data Cloud.
229221
230222 Args:
231223 name (str): The name of the DMO.
232224 schema (Optional[Union[AtomicType, StructType, str]]): Schema of the DMO.
233- row_limit (Optional[int]): Maximum number of rows to fetch.
234- When ``None``, the configured ``default_row_limit`` is used.
235225
236226 Returns:
237227 PySparkDataFrame: The PySpark DataFrame.
@@ -240,9 +230,9 @@ def read_dmo(
240230 self , "_sf_cli_reader" , None
241231 )
242232 if sf_cli_reader is not None :
243- return sf_cli_reader .read_dmo (name , schema , row_limit )
233+ return sf_cli_reader .read_dmo (name , schema )
244234
245- query = self ._build_query (name , row_limit )
235+ query = self ._build_query (name )
246236
247237 assert self ._conn is not None
248238 pandas_df = self ._conn .get_pandas_dataframe (query )
0 commit comments