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

docs(python): Fix substr function param definition #19054

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 crates/polars-sql/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,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
Loading