class_docstr: Run SQL queries against DataFrame/LazyFrame data.
  
  Warnings
  --------
  This feature is stabilising, but is still considered experimental and
  changes may be made without them necessarily being considered breaking.
class_docstr_tok: ["Run","SQL","queries","against","DataFrame\/LazyFrame","data",".","Warnings","--","--","--","--","This","feature","is","stabilising",",","but","is","still","considered","experimental","and","changes","may","be","made","without","them","necessarily","being","considered","breaking","."]
docstr: Initialise a new `SQLContext`.
  
  Parameters
  ----------
  frames
      A `{name:frame, ...}` mapping.
  register_globals
      Register all eager/lazy frames found in the globals, automatically
      mapping their variable name to a table name. If given an integer
      then only the most recent "n" frames found will be registered.
  eager_execution
      Return query execution results as `DataFrame` instead of `LazyFrame`.
      (Note that the query itself is always executed in lazy-mode; this
      parameter impacts whether :meth:`execute` returns an eager or lazy
      result frame).
  **named_frames
      Named eager/lazy frames, provided as kwargs.
  
  Examples
  --------
  >>> lf = pl.LazyFrame({"a": [1, 2, 3], "b": ["x", None, "z"]})
  >>> res = pl.SQLContext(frame=lf).execute(
  ...     "SELECT b, a*2 AS two_a FROM frame WHERE b IS NOT NULL"
  ... )
  >>> res.collect()
  shape: (2, 2)
  ┌─────┬───────┐
  │ b   ┆ two_a │
  │ --- ┆ ---   │
  │ str ┆ i64   │
  ╞═════╪═══════╡
  │ x   ┆ 2     │
  │ z   ┆ 6     │
  └─────┴───────┘
docstr_tok: ["Initialise","a","new","`","SQLContext","`",".","Parameters","--","--","--","--","--","frames","A","`","{","name",":","frame",",","...","}","`","mapping",".","register_globals","Register","all","eager\/lazy","frames","found","in","the","globals",",","automatically","mapping","their","variable","name","to","a","table","name",".","If","given","an","integer","then","only","the","most","recent","``","n","''","frames","found","will","be","registered",".","eager_execution","Return","query","execution","results","as","`","DataFrame","`","instead","of","`","LazyFrame","`",".","(","Note","that","the","query","itself","is","always","executed","in","lazy-mode",";","this","parameter","impacts","whether",":","meth",":","`","execute","`","returns","an","eager","or","lazy","result","frame",")",".","*","*","named_frames","Named","eager\/lazy","frames",",","provided","as","kwargs",".","Examples","--","--","--","--",">",">",">","lf","=","pl.LazyFrame","(","{","``","a","''",":","[","1",",","2",",","3","]",",","``","b","''",":","[","``","x","''",",","None",",","``","z","''","]","}",")",">",">",">","res","=","pl.SQLContext","(","frame=lf",")",".execute","(","...","``","SELECT","b",",","a","*","2","AS","two_a","FROM","frame","WHERE","b","IS","NOT","NULL","''","...",")",">",">",">","res.collect","(",")","shape",":","(","2",",","2",")","\u250c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","b","\u2506","two_a","\u2502","\u2502","--","-","\u2506","--","-","\u2502","\u2502","str","\u2506","i64","\u2502","\u255e\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","x","\u2506","2","\u2502","\u2502","z","\u2506","6","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"]
code: def __init__(
      self,
      frames: Mapping[str, DataFrame | LazyFrame] | None = None,
      *,
      register_globals: bool | int = False,
      eager_execution: bool = False,
      **named_frames: DataFrame | LazyFrame,
  ) -> None:
      """
      Initialise a new `SQLContext`.
  
      Parameters
      ----------
      frames
          A `{name:frame, ...}` mapping.
      register_globals
          Register all eager/lazy frames found in the globals, automatically
          mapping their variable name to a table name. If given an integer
          then only the most recent "n" frames found will be registered.
      eager_execution
          Return query execution results as `DataFrame` instead of `LazyFrame`.
          (Note that the query itself is always executed in lazy-mode; this
          parameter impacts whether :meth:`execute` returns an eager or lazy
          result frame).
      **named_frames
          Named eager/lazy frames, provided as kwargs.
  
      Examples
      --------
      >>> lf = pl.LazyFrame({"a": [1, 2, 3], "b": ["x", None, "z"]})
      >>> res = pl.SQLContext(frame=lf).execute(
      ...     "SELECT b, a*2 AS two_a FROM frame WHERE b IS NOT NULL"
      ... )
      >>> res.collect()
      shape: (2, 2)
      ┌─────┬───────┐
      │ b   ┆ two_a │
      │ --- ┆ ---   │
      │ str ┆ i64   │
      ╞═════╪═══════╡
      │ x   ┆ 2     │
      │ z   ┆ 6     │
      └─────┴───────┘
  
      """
      self._ctxt = PySQLContext.new()
      self._eager_execution = eager_execution
  
      frames = dict(frames or {})
      if register_globals:
          for name, obj in _get_stack_locals(
              of_type=(DataFrame, LazyFrame),
              n_objects=None if (register_globals is True) else None,
          ).items():
              if name not in frames and name not in named_frames:
                  named_frames[name] = obj
  
      if frames or named_frames:
          self.register_many(frames, **named_frames)
  
imports: from __future__ import annotations
  import contextlib
  from typing import TYPE_CHECKING, Collection, Generic, Mapping, overload
  from polars.dataframe import DataFrame
  from polars.lazyframe import LazyFrame
  from polars.type_aliases import FrameType
  from polars.utils._wrap import wrap_ldf
  from polars.utils.various import _get_stack_locals
label_desc: Use image node_id 3 to create a new SQLContext object from inherited base classes: Generic with example: obj = SQLContext(frames)