class_docstr: Namespace for datetime related expressions.
docstr: Extract seconds from underlying DateTime representation.
  
  Applies to Datetime columns.
  
  Returns the integer second number from 0 to 59, or a floating
  point number from 0 < 60 if `fractional=True` that includes
  any milli/micro/nanosecond component.
  
  Parameters
  ----------
  fractional
      Whether to include the fractional component of the second.
  
  Returns
  -------
  Expr
      Expression of data type :class:`Int8` or :class:`Float64`.
  
  Examples
  --------
  >>> from datetime import datetime
  >>> df = pl.DataFrame(
  ...     {
  ...         "datetime": [
  ...             datetime(2000, 1, 1, 0, 0, 0, 456789),
  ...             datetime(2000, 1, 1, 0, 0, 3, 111110),
  ...             datetime(2000, 1, 1, 0, 0, 5, 765431),
  ...         ]
  ...     }
  ... )
  >>> df.with_columns(pl.col("datetime").dt.second().alias("second"))
  shape: (3, 2)
  ┌────────────────────────────┬────────┐
  │ datetime                   ┆ second │
  │ ---                        ┆ ---    │
  │ datetime[μs]               ┆ i8     │
  ╞════════════════════════════╪════════╡
  │ 2000-01-01 00:00:00.456789 ┆ 0      │
  │ 2000-01-01 00:00:03.111110 ┆ 3      │
  │ 2000-01-01 00:00:05.765431 ┆ 5      │
  └────────────────────────────┴────────┘
  >>> df.with_columns(
  ...     pl.col("datetime").dt.second(fractional=True).alias("second")
  ... )
  shape: (3, 2)
  ┌────────────────────────────┬──────────┐
  │ datetime                   ┆ second   │
  │ ---                        ┆ ---      │
  │ datetime[μs]               ┆ f64      │
  ╞════════════════════════════╪══════════╡
  │ 2000-01-01 00:00:00.456789 ┆ 0.456789 │
  │ 2000-01-01 00:00:03.111110 ┆ 3.11111  │
  │ 2000-01-01 00:00:05.765431 ┆ 5.765431 │
  └────────────────────────────┴──────────┘
docstr_tok: ["Extract","seconds","from","underlying","DateTime","representation",".","Applies","to","Datetime","columns",".","Returns","the","integer","second","number","from","0","to","59",",","or","a","floating","point","number","from","0","<","60","if","`","fractional=True","`","that","includes","any","milli\/micro\/nanosecond","component",".","Parameters","--","--","--","--","--","fractional","Whether","to","include","the","fractional","component","of","the","second",".","Returns","--","--","--","-","Expr","Expression","of","data","type",":","class",":","`","Int8","`","or",":","class",":","`","Float64","`",".","Examples","--","--","--","--",">",">",">","from","datetime","import","datetime",">",">",">","df","=","pl.DataFrame","(","...","{","...","``","datetime","''",":","[","...","datetime","(","2000",",","1",",","1",",","0",",","0",",","0",",","456789",")",",","...","datetime","(","2000",",","1",",","1",",","0",",","0",",","3",",","111110",")",",","...","datetime","(","2000",",","1",",","1",",","0",",","0",",","5",",","765431",")",",","...","]","...","}","...",")",">",">",">","df.with_columns","(","pl.col","(","``","datetime","''",")",".dt.second","(",")",".alias","(","``","second","''",")",")","shape",":","(","3",",","2",")","\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","datetime","\u2506","second","\u2502","\u2502","--","-","\u2506","--","-","\u2502","\u2502","datetime","[","\u03bcs","]","\u2506","i8","\u2502","\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","2000-01-01","00:00:00.456789","\u2506","0","\u2502","\u2502","2000-01-01","00:00:03.111110","\u2506","3","\u2502","\u2502","2000-01-01","00:00:05.765431","\u2506","5","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518",">",">",">","df.with_columns","(","...","pl.col","(","``","datetime","''",")",".dt.second","(","fractional=True",")",".alias","(","``","second","''",")","...",")","shape",":","(","3",",","2",")","\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","datetime","\u2506","second","\u2502","\u2502","--","-","\u2506","--","-","\u2502","\u2502","datetime","[","\u03bcs","]","\u2506","f64","\u2502","\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","2000-01-01","00:00:00.456789","\u2506","0.456789","\u2502","\u2502","2000-01-01","00:00:03.111110","\u2506","3.11111","\u2502","\u2502","2000-01-01","00:00:05.765431","\u2506","5.765431","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"]
code: def second(self, *, fractional: bool = False) -> Expr:
      """
      Extract seconds from underlying DateTime representation.
  
      Applies to Datetime columns.
  
      Returns the integer second number from 0 to 59, or a floating
      point number from 0 < 60 if `fractional=True` that includes
      any milli/micro/nanosecond component.
  
      Parameters
      ----------
      fractional
          Whether to include the fractional component of the second.
  
      Returns
      -------
      Expr
          Expression of data type :class:`Int8` or :class:`Float64`.
  
      Examples
      --------
      >>> from datetime import datetime
      >>> df = pl.DataFrame(
      ...     {
      ...         "datetime": [
      ...             datetime(2000, 1, 1, 0, 0, 0, 456789),
      ...             datetime(2000, 1, 1, 0, 0, 3, 111110),
      ...             datetime(2000, 1, 1, 0, 0, 5, 765431),
      ...         ]
      ...     }
      ... )
      >>> df.with_columns(pl.col("datetime").dt.second().alias("second"))
      shape: (3, 2)
      ┌────────────────────────────┬────────┐
      │ datetime                   ┆ second │
      │ ---                        ┆ ---    │
      │ datetime[μs]               ┆ i8     │
      ╞════════════════════════════╪════════╡
      │ 2000-01-01 00:00:00.456789 ┆ 0      │
      │ 2000-01-01 00:00:03.111110 ┆ 3      │
      │ 2000-01-01 00:00:05.765431 ┆ 5      │
      └────────────────────────────┴────────┘
      >>> df.with_columns(
      ...     pl.col("datetime").dt.second(fractional=True).alias("second")
      ... )
      shape: (3, 2)
      ┌────────────────────────────┬──────────┐
      │ datetime                   ┆ second   │
      │ ---                        ┆ ---      │
      │ datetime[μs]               ┆ f64      │
      ╞════════════════════════════╪══════════╡
      │ 2000-01-01 00:00:00.456789 ┆ 0.456789 │
      │ 2000-01-01 00:00:03.111110 ┆ 3.11111  │
      │ 2000-01-01 00:00:05.765431 ┆ 5.765431 │
      └────────────────────────────┴──────────┘
  
      """
      sec = wrap_expr(self._pyexpr.dt_second())
      return (
          sec
          + (
              wrap_expr(self._pyexpr.dt_nanosecond())
              / F.lit(1_000_000_000.0)
          )
          if fractional
          else sec
      )
  
imports: from __future__ import annotations
  import datetime
  from typing import TYPE_CHECKING
  import polars._reexport
  from polars import functions
  from polars.datatypes import DTYPE_TEMPORAL_UNITS, Date, Int32
  from polars.utils._parse_expr_input import parse_as_expression
  from polars.utils._wrap import wrap_expr
  from polars.utils.convert import _timedelta_to_pl_duration
  from polars.utils.deprecation import deprecate_renamed_function, deprecate_saturating, issue_deprecation_warning, rename_use_earliest_to_ambiguous
label_desc: Use image node_id 21 for calling the ExprDateTimeNameSpace obj's underlying member method code with example usage: obj.second() and returns: unknown