Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix typos and remove trailing whitespace #18024

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ body:
label: Reproducible example
description: >
Please follow [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) on how to
provide a minimal, copy-pastable example. Include the (wrong) output if applicable.
provide a minimal, copy-pasteable example. Include the (wrong) output if applicable.
value: |
```python

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ body:
label: Reproducible example
description: >
Please follow [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) on how to
provide a minimal, copy-pastable example. Include the (wrong) output if applicable.
provide a minimal, copy-pasteable example. Include the (wrong) output if applicable.
value: |
```rust

Expand Down
2 changes: 1 addition & 1 deletion docs/releases/upgrade/1.md
Original file line number Diff line number Diff line change
Expand Up @@ -1060,4 +1060,4 @@ However, for the LazyFrame properties, accessing these may have significant perf

To solve this, we added the `LazyFrame.collect_schema` method, which retrieves the schema and returns a `Schema` object.
The properties raise a `PerformanceWarning` and tell the user to use `collect_schema` instead.
We chose not to deprecate the properties for now to facilitatate writing code that is generic for both DataFrames and LazyFrames.
We chose not to deprecate the properties for now to facilitate writing code that is generic for both DataFrames and LazyFrames.
2 changes: 1 addition & 1 deletion py-polars/debug/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def launch_debugging() -> None:
print(f"pID = {pID}")

# Give the LLDB time to connect. Depending on how long it takes for your LLDB
# debugging session to initiatialize, you may have to adjust this setting.
# debugging session to initialize, you may have to adjust this setting.
time.sleep(LLDB_DEBUG_WAIT_TIME_SECONDS)

# Update sys.argv so that when exec() is called, the first argument is the script
Expand Down
2 changes: 1 addition & 1 deletion py-polars/docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
overloads_location = ["bottom"]


# -- Extension settings -----------------------------------------------------
# -- Extension settings ------------------------------------------------------

# sphinx.ext.intersphinx - link to other projects' documentation
# https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html
Expand Down
2 changes: 1 addition & 1 deletion py-polars/docs/source/reference/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Note that ``Config`` supports setting context-scoped options. These options
are valid *only* during scope lifetime, and are reset to their initial values
(whatever they were before entering the new context) on scope exit.

You can take advantage of this by initialising a``Config`` instance and then
You can take advantage of this by initialising a ``Config`` instance and then
explicitly calling one or more of the available "set\_" methods on it...

.. code-block:: python
Expand Down
2 changes: 1 addition & 1 deletion py-polars/docs/source/reference/sql/clauses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Specifies the table(s) from which to retrieve or delete data.

JOIN
----
Combines rows from two or more tables based on a related column.
Combines rows from two or more tables based on a related column.

**Join Types**

Expand Down
2 changes: 1 addition & 1 deletion py-polars/docs/source/reference/sql/functions/array.rst
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Returns the mean of all values in an array.
**Example:**

.. code-block:: python

df = pl.DataFrame({"foo": [[1, 2], [4, 3, -1]]})
df.sql("""
SELECT foo, ARRAY_MEAN(foo) AS foo_mean FROM self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Returns the greatest value in the list of expressions.

df = pl.DataFrame(
{
"foo": [100, 200, 300, 400],
"foo": [100, 200, 300, 400],
"bar": [20, 10, 30, 40]
}
)
Expand Down
2 changes: 1 addition & 1 deletion py-polars/docs/source/reference/sql/functions/string.rst
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Returns the value with the first letter capitalized.
**Example:**

.. code-block:: python

df = pl.DataFrame({"bar": ["zz", "yy", "xx", "ww"]})
df.sql("""
SELECT bar, INITCAP(bar) AS baz FROM self
Expand Down
2 changes: 1 addition & 1 deletion py-polars/polars/dataframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2339,7 +2339,7 @@ def to_series(self, index: int = 0) -> Series:

def to_init_repr(self, n: int = 1000) -> str:
"""
Convert DataFrame to instantiatable string representation.
Convert DataFrame to instantiable string representation.

Parameters
----------
Expand Down
10 changes: 5 additions & 5 deletions py-polars/polars/expr/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,12 @@ def __array_ufunc__(
# We rename all but the first expression in case someone did e.g.
# np.divide(pl.col("a"), pl.col("a")); we'll be creating a struct
# below, and structs can't have duplicate names.
first_renamable_expr = True
first_renameable_expr = True
actual_exprs = []
for inp, is_actual_expr, index in exprs:
if is_actual_expr:
if first_renamable_expr:
first_renamable_expr = False
if first_renameable_expr:
first_renameable_expr = False
else:
inp = inp.alias(f"argument_{index}")
actual_exprs.append(inp)
Expand Down Expand Up @@ -8579,7 +8579,7 @@ def skew(self, *, bias: bool = True) -> Expr:

is the biased sample :math:`i\texttt{th}` central moment, and
:math:`\bar{x}` is
the sample mean. If `bias` is False, the calculations are
the sample mean. If `bias` is False, the calculations are
corrected for bias and the value computed is the adjusted
Fisher-Pearson standardized moment coefficient, i.e.

Expand Down Expand Up @@ -9663,7 +9663,7 @@ def extend_constant(self, value: IntoExpr, n: int | IntoExprColumn) -> Expr:
Parameters
----------
value
A constant literal value or a unit expressioin with which to extend the
A constant literal value or a unit expression with which to extend the
expression result Series; can pass None to extend with nulls.
n
The number of additional values that will be added.
Expand Down
6 changes: 3 additions & 3 deletions py-polars/polars/expr/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ def find(
--------
>>> df = pl.DataFrame(
... {
... "txt": ["Crab", "Lobster", None, "Crustaceon"],
... "txt": ["Crab", "Lobster", None, "Crustacean"],
... "pat": ["a[bc]", "b.t", "[aeiuo]", "(?i)A[BC]"],
... }
... )
Expand All @@ -1046,7 +1046,7 @@ def find(
│ Crab ┆ 2 ┆ null │
│ Lobster ┆ 5 ┆ 5 │
│ null ┆ null ┆ null │
Crustaceon ┆ 5 ┆ 7 │
Crustacean ┆ 5 ┆ 7 │
└────────────┴─────────────┴─────────┘

Match against a pattern found in another column or (expression):
Expand All @@ -1061,7 +1061,7 @@ def find(
│ Crab ┆ a[bc] ┆ 2 │
│ Lobster ┆ b.t ┆ 2 │
│ null ┆ [aeiuo] ┆ null │
Crustaceon ┆ (?i)A[BC] ┆ 5 │
Crustacean ┆ (?i)A[BC] ┆ 5 │
└────────────┴───────────┴──────────┘
"""
pattern = parse_into_expression(pattern, str_as_lit=True)
Expand Down
4 changes: 2 additions & 2 deletions py-polars/polars/functions/lazy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2108,7 +2108,7 @@ def rolling_cov(
The number of values in the window that should be non-null before computing
a result. If None, it will be set equal to window size.
ddof
Delta degrees of freedom. The divisor used in calculations
Delta degrees of freedom. The divisor used in calculations
is `N - ddof`, where `N` represents the number of elements.
"""
if min_periods is None:
Expand Down Expand Up @@ -2153,7 +2153,7 @@ def rolling_corr(
The number of values in the window that should be non-null before computing
a result. If None, it will be set equal to window size.
ddof
Delta degrees of freedom. The divisor used in calculations
Delta degrees of freedom. The divisor used in calculations
is `N - ddof`, where `N` represents the number of elements.
"""
if min_periods is None:
Expand Down
2 changes: 1 addition & 1 deletion py-polars/polars/io/iceberg.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def _to_ast(expr: str) -> ast.expr:

@singledispatch
def _convert_predicate(a: Any) -> Any:
"""Walks the AST to convert the PyArrow expression to a PyIceberg expression."""
"""Walks the AST to convert the PyArrow expression to a PyIceberg expression."""
msg = f"Unexpected symbol: {a}"
raise ValueError(msg)

Expand Down
6 changes: 3 additions & 3 deletions py-polars/polars/lazyframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2299,7 +2299,7 @@ def sink_parquet(
If not set defaults to 1024 * 1024 bytes
maintain_order
Maintain the order in which data is processed.
Setting this to `False` will be slightly faster.
Setting this to `False` will be slightly faster.
type_coercion
Do type coercion optimization.
predicate_pushdown
Expand Down Expand Up @@ -2390,7 +2390,7 @@ def sink_ipc(
Choose "lz4" for fast compression/decompression.
maintain_order
Maintain the order in which data is processed.
Setting this to `False` will be slightly faster.
Setting this to `False` will be slightly faster.
type_coercion
Do type coercion optimization.
predicate_pushdown
Expand Down Expand Up @@ -2520,7 +2520,7 @@ def sink_csv(
necessary.
maintain_order
Maintain the order in which data is processed.
Setting this to `False` will be slightly faster.
Setting this to `False` will be slightly faster.
type_coercion
Do type coercion optimization.
predicate_pushdown
Expand Down
2 changes: 1 addition & 1 deletion py-polars/polars/meta/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def _get_dependency_info() -> dict[str, str]:


def _get_dependency_version(dep_name: str) -> str:
# note: we import 'importlib' here as a significiant optimisation for initial import
# note: we import 'importlib' here as a significant optimisation for initial import
import importlib
import importlib.metadata

Expand Down
8 changes: 4 additions & 4 deletions py-polars/polars/series/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def _export_arrow_to_c(self, out_ptr: int, out_schema_ptr: int) -> None:

Leaking
If you don't pass the ArrowArray struct to a consumer,
array memory will leak. This is a low-level function intended for
array memory will leak. This is a low-level function intended for
expert users.
"""
self._s._export_arrow_to_c(out_ptr, out_schema_ptr)
Expand Down Expand Up @@ -4507,7 +4507,7 @@ def to_pandas(

def to_init_repr(self, n: int = 1000) -> str:
"""
Convert Series to instantiatable string representation.
Convert Series to instantiable string representation.

Parameters
----------
Expand Down Expand Up @@ -6373,7 +6373,7 @@ def skew(self, *, bias: bool = True) -> float | None:

is the biased sample :math:`i\texttt{th}` central moment, and
:math:`\bar{x}` is
the sample mean. If `bias` is False, the calculations are
the sample mean. If `bias` is False, the calculations are
corrected for bias and the value computed is the adjusted
Fisher-Pearson standardized moment coefficient, i.e.

Expand Down Expand Up @@ -7182,7 +7182,7 @@ def extend_constant(self, value: IntoExpr, n: int | IntoExprColumn) -> Series:
Parameters
----------
value
A constant literal value or a unit expressioin with which to extend the
A constant literal value or a unit expression with which to extend the
expression result Series; can pass None to extend with nulls.
n
The number of additional values that will be added.
Expand Down
2 changes: 1 addition & 1 deletion py-polars/polars/series/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ def find(

Examples
--------
>>> s = pl.Series("txt", ["Crab", "Lobster", None, "Crustaceon"])
>>> s = pl.Series("txt", ["Crab", "Lobster", None, "Crustacean"])

Find the index of the first substring matching a regex pattern:

Expand Down
2 changes: 1 addition & 1 deletion py-polars/src/conversion/any_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ pub(crate) fn py_object_to_any_value<'py>(
// with abi3 for versions older than Python 3.10, the APIs that purport
// to return &str actually just encode to UTF-8 as a newly allocated
// PyBytes object, and then return reference to that. So what we're
// doing here isn't any different fundamantelly, and the APIs to for
// doing here isn't any different fundamentally, and the APIs to for
// converting to &str are deprecated in PyO3 0.21.
//
// Once Python 3.10 is the minimum supported version, converting to &str
Expand Down
2 changes: 1 addition & 1 deletion py-polars/src/lazyframe/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub(crate) struct NodeTraverser {

impl NodeTraverser {
// Versioning for IR, (major, minor)
// Incremement major on breaking changes to the IR (e.g. renaming
// Increment major on breaking changes to the IR (e.g. renaming
// fields, reordering tuples), minor on backwards compatible
// changes (e.g. exposing a new expression node).
const VERSION: Version = (1, 0);
Expand Down
26 changes: 13 additions & 13 deletions py-polars/tests/benchmark/data/tpch/dbgen/dists.dss
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
#
# <token> | <weight> # comment
#
# Distributions are used to bias the selection of a token
# based on its associated weight. The list of tokens and values
# Distributions are used to bias the selection of a token
# based on its associated weight. The list of tokens and values
# between the keywords BEGIN and END define the distribution named after
# the BEGIN. A uniformly random value from [0, sum(weights)]
# will be chosen and the first token whose cumulative weight is greater than
# or equal to the result will be returned. In essence, the weights for each
# token represent its relative weight within a distribution.
#
# one special token is defined: count (number of data points in the
# one special token is defined: count (number of data points in the
# distribution). It MUST be defined for each named distribution.
#-----------------------------------------------------------------------
# currently defined distributions and their use:
Expand All @@ -49,11 +49,11 @@
# rflag lineitems.returnflag
# types parts.type
# colors embedded string creation; CANNOT BE USED FOR pick_str(), agg_str() perturbs order
# articles comment generation
# nouns
# verbs
# adverbs
# auxillaries
# articles comment generation
# nouns
# verbs
# adverbs
# auxillaries
# prepositions
# terminators
# grammar sentence formation
Expand Down Expand Up @@ -693,7 +693,7 @@ near|1
of|1
on|1
outside|1
over|1
over|1
past|1
since|1
through|1
Expand All @@ -702,7 +702,7 @@ to|1
toward|1
under|1
until|1
up|1
up|1
upon|1
whithout|1
with|1
Expand Down Expand Up @@ -794,7 +794,7 @@ N P V P T|1
END grammar
###
# NP
# second level grammar. Noun phrases. N=noun, A=article,
# second level grammar. Noun phrases. N=noun, A=article,
# J=adjective, D=adverb
##
BEGIN np
Expand All @@ -806,7 +806,7 @@ D J N|50
END np
###
# VP
# second level grammar. Verb phrases. V=verb, X=auxiallary,
# second level grammar. Verb phrases. V=verb, X=auxiallary,
# D=adverb
##
BEGIN vp
Expand All @@ -818,7 +818,7 @@ X V D|1
END vp
###
# Q13
# Substitution parameters for Q13
# Substitution parameters for Q13
##
BEGIN Q13a
COUNT|4
Expand Down
2 changes: 1 addition & 1 deletion py-polars/tests/unit/interop/numpy/test_ufunc_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def test_generalized_ufunc_missing_data() -> None:

While this particular example isn't necessarily a semantic issue, consider
a mean() function running on integers: it will give wrong results if the
input is missing data, since NumPy has no way to model missing slots. In
input is missing data, since NumPy has no way to model missing slots. In
the general case, we can't assume the function will handle missing data
correctly.
"""
Expand Down
2 changes: 1 addition & 1 deletion py-polars/tests/unit/lazyframe/cuda/test_node_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def test_run_on_pandas() -> None:
# Simple join example, missing multiple columns, slices, etc.
def join(
inputs: list[Callable[[], pd.DataFrame]], obj: Any, _node_traverer: Any
inputs: list[Callable[[], pd.DataFrame]], obj: Any, _node_traverser: Any
) -> Callable[[], pd.DataFrame]:
assert len(obj.left_on) == 1
assert len(obj.right_on) == 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ def test_list_slice_5866() -> None:

def test_list_gather() -> None:
s = pl.Series("a", [[1, 2, 3], [4, 5], [6, 7, 8]])
# mypy: we make it work, but idomatic is `arr.get`.
# mypy: we make it work, but idiomatic is `arr.get`.
assert s.list.gather(0).to_list() == [[1], [4], [6]] # type: ignore[arg-type]
assert s.list.gather([0, 1]).to_list() == [[1, 2], [4, 5], [6, 7]]

Expand Down
2 changes: 1 addition & 1 deletion py-polars/tests/unit/operations/rolling/test_rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ def test_rolling_min_periods(
)["value"]
assert_series_equal(result, pl.Series("value", expected, pl.Int64))

# Startig with unsorted data
# Starting with unsorted data
result = (
df.sort("date", descending=True)
.with_columns(
Expand Down
Loading