bjornjorgensen commented on code in PR #38824:
URL: https://github.com/apache/spark/pull/38824#discussion_r1034044119
##########
python/pyspark/sql/connect/dataframe.py:
##########
@@ -409,9 +441,39 @@ def join(
)
def limit(self, n: int) -> "DataFrame":
+ """Limits the result count to the number specified.
+
+ .. versionadded:: 3.4.0
+
+ Parameters
+ ----------
+ num : int
+ Number of records to return. Will return this number of records
+ or whataver number is available.
+
+ Returns
+ -------
+ :class:`DataFrame`
+ Subset of the records
+ """
return DataFrame.withPlan(plan.Limit(child=self._plan, limit=n),
session=self._session)
def offset(self, n: int) -> "DataFrame":
+ """Returns a new :class: `DataFrame` by skipping the first `n` rows.
+ .
+ .. versionadded:: 3.4.0
+
+ Parameters
+ ----------
+ num : int
+ Number of records to return. Will return this number of
records
+ or whataver number is available.
Review Comment:
whataver -> whatever
##########
python/pyspark/sql/connect/dataframe.py:
##########
@@ -457,6 +519,31 @@ def sample(
withReplacement: bool = False,
seed: Optional[int] = None,
) -> "DataFrame":
+ """Returns a sampled subset of this :class:`DataFrame`.
+
+ .. versionadded:: 3.4.0
+
+ Parameters
+ ----------
+ withReplacement : bool, optional
+ Sample with replacement or not (default ``False``).
+ fraction : float
+ Fraction of rows to generate, range [0.0, 1.0].
+ seed : int, optional
+ Seed for sampling (default a random seed).
+
+ Returns
+ -------
+ :class:`DataFrame`
+ Sampled rows from given DataFrame.
Review Comment:
Sampled -> Sample
##########
python/pyspark/sql/connect/dataframe.py:
##########
@@ -409,9 +441,39 @@ def join(
)
def limit(self, n: int) -> "DataFrame":
+ """Limits the result count to the number specified.
+
+ .. versionadded:: 3.4.0
+
+ Parameters
+ ----------
+ num : int
+ Number of records to return. Will return this number of records
+ or whataver number is available.
Review Comment:
whataver -> whatever
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]