From 2503956e832e81041b32b7ab5f6f3a2177c77f00 Mon Sep 17 00:00:00 2001 From: Ondrej Zeman Date: Mon, 16 Dec 2024 14:33:26 +0100 Subject: [PATCH] docs(python): Fix substr function param definition (#19054) --- crates/polars-sql/src/functions.rs | 2 +- py-polars/docs/source/reference/sql/functions/string.rst | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/polars-sql/src/functions.rs b/crates/polars-sql/src/functions.rs index ff1a926f27e3..988ef74692e2 100644 --- a/crates/polars-sql/src/functions.rs +++ b/crates/polars-sql/src/functions.rs @@ -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; diff --git a/py-polars/docs/source/reference/sql/functions/string.rst b/py-polars/docs/source/reference/sql/functions/string.rst index 02ca13fd740b..555e696f8dc6 100644 --- a/py-polars/docs/source/reference/sql/functions/string.rst +++ b/py-polars/docs/source/reference/sql/functions/string.rst @@ -45,8 +45,8 @@ String - Returns the index of the given substring in the target string. * - :ref:`STRPTIME ` - Converts a string to a Datetime using a strftime-compatible formatting string. - * - :ref:`SUBSTRING ` - - Returns a portion of the data (first character = 0) in the range [start, start + length]. + * - :ref:`SUBSTR ` + - Returns a portion of the data (first character = 1) in the range [start, start + length]. * - :ref:`TIMESTAMP ` - Converts a formatted timestamp/datetime string to an actual Datetime value. * - :ref:`UPPER ` @@ -617,9 +617,9 @@ Converts a string to a Datetime using a `chrono strftime