Skip to content

Commit

Permalink
docs(python): Fix substr function param definition (#19054)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZemanOndrej authored Dec 16, 2024
1 parent ff95fad commit 2503956
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/polars-sql/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ pub(crate) enum PolarsSQLFunctions {
/// ```
StrPos,
/// SQL 'substr' function
/// Returns a portion of the data (first character = 0) in the range.
/// Returns a portion of the data (first character = 1) in the range.
/// \[start, start + length]
/// ```sql
/// SELECT SUBSTR(column_1, 3, 5) FROM df;
Expand Down
8 changes: 4 additions & 4 deletions py-polars/docs/source/reference/sql/functions/string.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ String
- Returns the index of the given substring in the target string.
* - :ref:`STRPTIME <strptime>`
- Converts a string to a Datetime using a strftime-compatible formatting string.
* - :ref:`SUBSTRING <substring>`
- Returns a portion of the data (first character = 0) in the range [start, start + length].
* - :ref:`SUBSTR <substr>`
- Returns a portion of the data (first character = 1) in the range [start, start + length].
* - :ref:`TIMESTAMP <timestamp>`
- Converts a formatted timestamp/datetime string to an actual Datetime value.
* - :ref:`UPPER <upper>`
Expand Down Expand Up @@ -617,9 +617,9 @@ Converts a string to a Datetime using a `chrono strftime <https://docs.rs/chrono
# │ 2077 Feb 28 ┆ 10.45.00 ┆ 2077-02-28 10:45:00 │
# └─────────────┴──────────┴─────────────────────┘
.. _substring:
.. _substr:

SUBSTRING
SUBSTR
---------
Returns a slice of the string data (1-indexed) in the range [start, start + length].

Expand Down

0 comments on commit 2503956

Please sign in to comment.