-

DuckDB is an embeddable SQL OLAP Database Management System

-
+
-duckdb.threadsafety bool +duckdb.threadsafety bool

Indicates that this package is threadsafe

@@ -20,7 +19,7 @@ title: Python Client API
-duckdb.apilevel int +duckdb.apilevel int

Indicates which Python DBAPI version this package implements

@@ -29,7 +28,7 @@ title: Python Client API
-duckdb.paramstyle str +duckdb.paramstyle str

Indicates which parameter style duckdb supports

@@ -38,85 +37,173 @@ title: Python Client API
-duckdb.default_connection duckdb.DuckDBPyConnection +duckdb.default_connection duckdb.DuckDBPyConnection

The connection that is used by default if you don’t explicitly pass one to the root methods in this module

+
+
+class duckdb.BinaryValue(object: Any) +
+
+

Bases: Value

+
+
+
-exception duckdb.BinderException +exception duckdb.BinderException +
+
+

Bases: ProgrammingError

+
+
+ +
+
+class duckdb.BitValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.BlobValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.BooleanValue(object: Any)
-

Bases: ProgrammingError

+

Bases: Value

+
+
+duckdb.CaseExpression(condition: duckdb.duckdb.Expression, value: duckdb.duckdb.Expression) duckdb.duckdb.Expression +
+
+
+
-exception duckdb.CastException +exception duckdb.CastException
-

Bases: DataError

+

Bases: DataError

-exception duckdb.CatalogException +exception duckdb.CatalogException +
+
+

Bases: ProgrammingError

+
+
+ +
+
+duckdb.ColumnExpression(name: str) duckdb.duckdb.Expression
-

Bases: ProgrammingError

+

Create a column reference from the provided column name

-exception duckdb.ConnectionException +exception duckdb.ConnectionException +
+
+

Bases: OperationalError

+
+
+ +
+
+duckdb.ConstantExpression(value: object) duckdb.duckdb.Expression
-

Bases: OperationalError

+

Create a constant expression from the provided value

-exception duckdb.ConstraintException +exception duckdb.ConstraintException
-

Bases: IntegrityError

+

Bases: IntegrityError

-exception duckdb.ConversionException +exception duckdb.ConversionException
-

Bases: DataError

+

Bases: DataError

-exception duckdb.DataError +exception duckdb.DataError +
+
+

Bases: Error

+
+
+ +
+
+class duckdb.DateValue(object: Any)
-

Bases: Error

+

Bases: Value

+
+
+ +
+
+class duckdb.DecimalValue(object: Any, width: int, scale: int) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.DoubleValue(object: Any) +
+
+

Bases: Value

-class duckdb.DuckDBPyConnection +class duckdb.DuckDBPyConnection

Bases: pybind11_object

-append(self: duckdb.DuckDBPyConnection, table_name: str, df: pandas.DataFrame, *, by_name: bool = False) duckdb.DuckDBPyConnection +append(self: duckdb.duckdb.DuckDBPyConnection, table_name: str, df: pandas.DataFrame, *, by_name: bool = False) duckdb.duckdb.DuckDBPyConnection

Append the passed DataFrame to the named table

@@ -125,7 +212,7 @@ title: Python Client API
-array_type(self: duckdb.DuckDBPyConnection, type: duckdb.typing.DuckDBPyType) duckdb.typing.DuckDBPyType +array_type(self: duckdb.duckdb.DuckDBPyConnection, type: duckdb.duckdb.typing.DuckDBPyType) duckdb.duckdb.typing.DuckDBPyType

Create an array type object of ‘type’

@@ -134,7 +221,7 @@ title: Python Client API
-arrow(self: duckdb.DuckDBPyConnection, rows_per_batch: int = 1000000) pyarrow.lib.Table +arrow(self: duckdb.duckdb.DuckDBPyConnection, rows_per_batch: int = 1000000) pyarrow.lib.Table

Fetch a result as Arrow table following execute()

@@ -143,7 +230,7 @@ title: Python Client API
-begin(self: duckdb.DuckDBPyConnection) duckdb.DuckDBPyConnection +begin(self: duckdb.duckdb.DuckDBPyConnection) duckdb.duckdb.DuckDBPyConnection

Start a new transaction

@@ -152,7 +239,7 @@ title: Python Client API
-close(self: duckdb.DuckDBPyConnection) None +close(self: duckdb.duckdb.DuckDBPyConnection) None

Close the connection

@@ -161,7 +248,7 @@ title: Python Client API
-commit(self: duckdb.DuckDBPyConnection) duckdb.DuckDBPyConnection +commit(self: duckdb.duckdb.DuckDBPyConnection) duckdb.duckdb.DuckDBPyConnection

Commit changes performed within a transaction

@@ -170,7 +257,7 @@ title: Python Client API
-create_function(self: duckdb.DuckDBPyConnection, name: str, function: function, return_type: object = None, parameters: duckdb.typing.DuckDBPyType = None, *, type: duckdb.functional.PythonUDFType = <PythonUDFType.NATIVE: 0>, null_handling: duckdb.functional.FunctionNullHandling = 0, exception_handling: duckdb.PythonExceptionHandling = 0, side_effects: bool = False) duckdb.DuckDBPyConnection +create_function(self: duckdb.duckdb.DuckDBPyConnection, name: str, function: function, return_type: object = None, parameters: duckdb.duckdb.typing.DuckDBPyType = None, *, type: duckdb.duckdb.functional.PythonUDFType = <PythonUDFType.NATIVE: 0>, null_handling: duckdb.duckdb.functional.FunctionNullHandling = 0, exception_handling: duckdb.duckdb.PythonExceptionHandling = 0, side_effects: bool = False) duckdb.duckdb.DuckDBPyConnection

Create a DuckDB function out of the passing in python function so it can be used in queries

@@ -179,7 +266,7 @@ title: Python Client API
-cursor(self: duckdb.DuckDBPyConnection) duckdb.DuckDBPyConnection +cursor(self: duckdb.duckdb.DuckDBPyConnection) duckdb.duckdb.DuckDBPyConnection

Create a duplicate of the current connection

@@ -188,7 +275,7 @@ title: Python Client API
-decimal_type(self: duckdb.DuckDBPyConnection, width: int, scale: int) duckdb.typing.DuckDBPyType +decimal_type(self: duckdb.duckdb.DuckDBPyConnection, width: int, scale: int) duckdb.duckdb.typing.DuckDBPyType

Create a decimal type with ‘width’ and ‘scale’

@@ -197,7 +284,7 @@ title: Python Client API
-property description +property description

Get result set attributes, mainly column names

@@ -206,7 +293,7 @@ title: Python Client API
-df(self: duckdb.DuckDBPyConnection, *, date_as_object: bool = False) pandas.DataFrame +df(self: duckdb.duckdb.DuckDBPyConnection, *, date_as_object: bool = False) pandas.DataFrame

Fetch a result as DataFrame following execute()

@@ -215,7 +302,7 @@ title: Python Client API
-dtype(self: duckdb.DuckDBPyConnection, type_str: str) duckdb.typing.DuckDBPyType +dtype(self: duckdb.duckdb.DuckDBPyConnection, type_str: str) duckdb.duckdb.typing.DuckDBPyType

Create a type object by parsing the ‘type_str’ string

@@ -224,7 +311,7 @@ title: Python Client API
-duplicate(self: duckdb.DuckDBPyConnection) duckdb.DuckDBPyConnection +duplicate(self: duckdb.duckdb.DuckDBPyConnection) duckdb.duckdb.DuckDBPyConnection

Create a duplicate of the current connection

@@ -233,7 +320,7 @@ title: Python Client API
-enum_type(self: duckdb.DuckDBPyConnection, name: str, type: duckdb.typing.DuckDBPyType, values: list) duckdb.typing.DuckDBPyType +enum_type(self: duckdb.duckdb.DuckDBPyConnection, name: str, type: duckdb.duckdb.typing.DuckDBPyType, values: list) duckdb.duckdb.typing.DuckDBPyType

Create an enum type of underlying ‘type’, consisting of the list of ‘values’

@@ -242,7 +329,7 @@ title: Python Client API
-execute(self: duckdb.DuckDBPyConnection, query: str, parameters: object = None, multiple_parameter_sets: bool = False) duckdb.DuckDBPyConnection +execute(self: duckdb.duckdb.DuckDBPyConnection, query: str, parameters: object = None, multiple_parameter_sets: bool = False) duckdb.duckdb.DuckDBPyConnection

Execute the given SQL query, optionally using prepared statements with parameters set

@@ -251,7 +338,7 @@ title: Python Client API
-executemany(self: duckdb.DuckDBPyConnection, query: str, parameters: object = None) duckdb.DuckDBPyConnection +executemany(self: duckdb.duckdb.DuckDBPyConnection, query: str, parameters: object = None) duckdb.duckdb.DuckDBPyConnection

Execute the given prepared statement multiple times using the list of parameter sets in parameters

@@ -260,7 +347,7 @@ title: Python Client API
-fetch_arrow_table(self: duckdb.DuckDBPyConnection, rows_per_batch: int = 1000000) pyarrow.lib.Table +fetch_arrow_table(self: duckdb.duckdb.DuckDBPyConnection, rows_per_batch: int = 1000000) pyarrow.lib.Table

Fetch a result as Arrow table following execute()

@@ -269,7 +356,7 @@ title: Python Client API
-fetch_df(self: duckdb.DuckDBPyConnection, *, date_as_object: bool = False) pandas.DataFrame +fetch_df(self: duckdb.duckdb.DuckDBPyConnection, *, date_as_object: bool = False) pandas.DataFrame

Fetch a result as DataFrame following execute()

@@ -278,7 +365,7 @@ title: Python Client API
-fetch_df_chunk(self: duckdb.DuckDBPyConnection, vectors_per_chunk: int = 1, *, date_as_object: bool = False) pandas.DataFrame +fetch_df_chunk(self: duckdb.duckdb.DuckDBPyConnection, vectors_per_chunk: int = 1, *, date_as_object: bool = False) pandas.DataFrame

Fetch a chunk of the result as Data.Frame following execute()

@@ -287,7 +374,7 @@ title: Python Client API
-fetch_record_batch(self: duckdb.DuckDBPyConnection, rows_per_batch: int = 1000000) pyarrow.lib.RecordBatchReader +fetch_record_batch(self: duckdb.duckdb.DuckDBPyConnection, rows_per_batch: int = 1000000) pyarrow.lib.RecordBatchReader

Fetch an Arrow RecordBatchReader following execute()

@@ -296,7 +383,7 @@ title: Python Client API
-fetchall(self: duckdb.DuckDBPyConnection) list +fetchall(self: duckdb.duckdb.DuckDBPyConnection) list

Fetch all rows from a result following execute

@@ -305,7 +392,7 @@ title: Python Client API
-fetchdf(self: duckdb.DuckDBPyConnection, *, date_as_object: bool = False) pandas.DataFrame +fetchdf(self: duckdb.duckdb.DuckDBPyConnection, *, date_as_object: bool = False) pandas.DataFrame

Fetch a result as DataFrame following execute()

@@ -314,7 +401,7 @@ title: Python Client API
-fetchmany(self: duckdb.DuckDBPyConnection, size: int = 1) list +fetchmany(self: duckdb.duckdb.DuckDBPyConnection, size: int = 1) list

Fetch the next set of rows from a result following execute

@@ -323,7 +410,7 @@ title: Python Client API
-fetchnumpy(self: duckdb.DuckDBPyConnection) dict +fetchnumpy(self: duckdb.duckdb.DuckDBPyConnection) dict

Fetch a result as list of NumPy arrays following execute

@@ -332,7 +419,7 @@ title: Python Client API
-fetchone(self: duckdb.DuckDBPyConnection) Optional[tuple] +fetchone(self: duckdb.duckdb.DuckDBPyConnection) Optional[tuple]

Fetch a single row from a result following execute

@@ -341,7 +428,7 @@ title: Python Client API
-filesystem_is_registered(self: duckdb.DuckDBPyConnection, name: str) bool +filesystem_is_registered(self: duckdb.duckdb.DuckDBPyConnection, name: str) bool

Check if a filesystem with the provided name is currently registered

@@ -350,7 +437,7 @@ title: Python Client API
-from_arrow(self: duckdb.DuckDBPyConnection, arrow_object: object) duckdb.DuckDBPyRelation +from_arrow(self: duckdb.duckdb.DuckDBPyConnection, arrow_object: object) duckdb.duckdb.DuckDBPyRelation

Create a relation object from an Arrow object

@@ -359,7 +446,7 @@ title: Python Client API
-from_csv_auto(self: duckdb.DuckDBPyConnection, name: object, *, header: object = None, compression: object = None, sep: object = None, delimiter: object = None, dtype: object = None, na_values: object = None, skiprows: object = None, quotechar: object = None, escapechar: object = None, encoding: object = None, parallel: object = None, date_format: object = None, timestamp_format: object = None, sample_size: object = None, all_varchar: object = None, normalize_names: object = None, filename: object = None, null_padding: object = None) duckdb.DuckDBPyRelation +from_csv_auto(self: duckdb.duckdb.DuckDBPyConnection, name: object, *, header: object = None, compression: object = None, sep: object = None, delimiter: object = None, dtype: object = None, na_values: object = None, skiprows: object = None, quotechar: object = None, escapechar: object = None, encoding: object = None, parallel: object = None, date_format: object = None, timestamp_format: object = None, sample_size: object = None, all_varchar: object = None, normalize_names: object = None, filename: object = None, null_padding: object = None, names: object = None) duckdb.duckdb.DuckDBPyRelation

Create a relation object from the CSV file in ‘name’

@@ -368,7 +455,7 @@ title: Python Client API
-from_df(self: duckdb.DuckDBPyConnection, df: pandas.DataFrame = None) duckdb.DuckDBPyRelation +from_df(self: duckdb.duckdb.DuckDBPyConnection, df: pandas.DataFrame = None) duckdb.duckdb.DuckDBPyRelation

Create a relation object from the Data.Frame in df

@@ -377,16 +464,16 @@ title: Python Client API
-from_parquet(*args, **kwargs) +from_parquet(*args, **kwargs)

Overloaded function.

    -
  1. from_parquet(self: duckdb.DuckDBPyConnection, file_glob: str, binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None) -> duckdb.DuckDBPyRelation

  2. +
  3. from_parquet(self: duckdb.duckdb.DuckDBPyConnection, file_glob: str, binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None) -> duckdb.duckdb.DuckDBPyRelation

Create a relation object from the Parquet files in file_glob

    -
  1. from_parquet(self: duckdb.DuckDBPyConnection, file_globs: List[str], binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None) -> duckdb.DuckDBPyRelation

  2. +
  3. from_parquet(self: duckdb.duckdb.DuckDBPyConnection, file_globs: List[str], binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None) -> duckdb.duckdb.DuckDBPyRelation

Create a relation object from the Parquet files in file_globs

@@ -394,7 +481,7 @@ title: Python Client API
-from_query(self: duckdb.DuckDBPyConnection, query: str, alias: str = 'query_relation') duckdb.DuckDBPyRelation +from_query(self: duckdb.duckdb.DuckDBPyConnection, query: str, *, alias: str = '', params: object = None) duckdb.duckdb.DuckDBPyRelation

Run a SQL query. If it is a SELECT statement, create a relation object from the given SQL query, otherwise run the query as-is.

@@ -403,7 +490,7 @@ title: Python Client API
-from_substrait(self: duckdb.DuckDBPyConnection, proto: bytes) duckdb.DuckDBPyRelation +from_substrait(self: duckdb.duckdb.DuckDBPyConnection, proto: bytes) duckdb.duckdb.DuckDBPyRelation

Create a query object from protobuf plan

@@ -412,7 +499,7 @@ title: Python Client API
-from_substrait_json(self: duckdb.DuckDBPyConnection, json: str) duckdb.DuckDBPyRelation +from_substrait_json(self: duckdb.duckdb.DuckDBPyConnection, json: str) duckdb.duckdb.DuckDBPyRelation

Create a query object from a JSON protobuf plan

@@ -421,7 +508,7 @@ title: Python Client API
-get_substrait(self: duckdb.DuckDBPyConnection, query: str, *, enable_optimizer: bool = True) duckdb.DuckDBPyRelation +get_substrait(self: duckdb.duckdb.DuckDBPyConnection, query: str, *, enable_optimizer: bool = True) duckdb.duckdb.DuckDBPyRelation

Serialize a query to protobuf

@@ -430,7 +517,7 @@ title: Python Client API
-get_substrait_json(self: duckdb.DuckDBPyConnection, query: str, *, enable_optimizer: bool = True) duckdb.DuckDBPyRelation +get_substrait_json(self: duckdb.duckdb.DuckDBPyConnection, query: str, *, enable_optimizer: bool = True) duckdb.duckdb.DuckDBPyRelation

Serialize a query to protobuf on the JSON format

@@ -439,7 +526,7 @@ title: Python Client API
-get_table_names(self: duckdb.DuckDBPyConnection, query: str) Set[str] +get_table_names(self: duckdb.duckdb.DuckDBPyConnection, query: str) Set[str]

Extract the required table names from a query

@@ -448,16 +535,25 @@ title: Python Client API
-install_extension(self: duckdb.DuckDBPyConnection, extension: str, *, force_install: bool = False) None +install_extension(self: duckdb.duckdb.DuckDBPyConnection, extension: str, *, force_install: bool = False) None

Install an extension by name

+
+
+interrupt(self: duckdb.duckdb.DuckDBPyConnection) None +
+
+

Interrupt pending operations

+
+
+
-list_filesystems(self: duckdb.DuckDBPyConnection) list +list_filesystems(self: duckdb.duckdb.DuckDBPyConnection) list

List registered filesystems, including builtin ones

@@ -466,7 +562,7 @@ title: Python Client API
-list_type(self: duckdb.DuckDBPyConnection, type: duckdb.typing.DuckDBPyType) duckdb.typing.DuckDBPyType +list_type(self: duckdb.duckdb.DuckDBPyConnection, type: duckdb.duckdb.typing.DuckDBPyType) duckdb.duckdb.typing.DuckDBPyType

Create an array type object of ‘type’

@@ -475,7 +571,7 @@ title: Python Client API
-load_extension(self: duckdb.DuckDBPyConnection, extension: str) None +load_extension(self: duckdb.duckdb.DuckDBPyConnection, extension: str) None

Load an installed extension

@@ -484,7 +580,7 @@ title: Python Client API
-map_type(self: duckdb.DuckDBPyConnection, key: duckdb.typing.DuckDBPyType, value: duckdb.typing.DuckDBPyType) duckdb.typing.DuckDBPyType +map_type(self: duckdb.duckdb.DuckDBPyConnection, key: duckdb.duckdb.typing.DuckDBPyType, value: duckdb.duckdb.typing.DuckDBPyType) duckdb.duckdb.typing.DuckDBPyType

Create a map type object from ‘key_type’ and ‘value_type’

@@ -493,7 +589,7 @@ title: Python Client API
-pl(self: duckdb.DuckDBPyConnection, rows_per_batch: int = 1000000) duckdb::PolarsDataFrame +pl(self: duckdb.duckdb.DuckDBPyConnection, rows_per_batch: int = 1000000) duckdb::PolarsDataFrame

Fetch a result as Polars DataFrame following execute()

@@ -502,7 +598,7 @@ title: Python Client API
-query(self: duckdb.DuckDBPyConnection, query: str, alias: str = 'query_relation') duckdb.DuckDBPyRelation +query(self: duckdb.duckdb.DuckDBPyConnection, query: str, *, alias: str = '', params: object = None) duckdb.duckdb.DuckDBPyRelation

Run a SQL query. If it is a SELECT statement, create a relation object from the given SQL query, otherwise run the query as-is.

@@ -511,7 +607,7 @@ title: Python Client API
-read_csv(self: duckdb.DuckDBPyConnection, name: object, *, header: object = None, compression: object = None, sep: object = None, delimiter: object = None, dtype: object = None, na_values: object = None, skiprows: object = None, quotechar: object = None, escapechar: object = None, encoding: object = None, parallel: object = None, date_format: object = None, timestamp_format: object = None, sample_size: object = None, all_varchar: object = None, normalize_names: object = None, filename: object = None, null_padding: object = None) duckdb.DuckDBPyRelation +read_csv(self: duckdb.duckdb.DuckDBPyConnection, name: object, *, header: object = None, compression: object = None, sep: object = None, delimiter: object = None, dtype: object = None, na_values: object = None, skiprows: object = None, quotechar: object = None, escapechar: object = None, encoding: object = None, parallel: object = None, date_format: object = None, timestamp_format: object = None, sample_size: object = None, all_varchar: object = None, normalize_names: object = None, filename: object = None, null_padding: object = None, names: object = None) duckdb.duckdb.DuckDBPyRelation

Create a relation object from the CSV file in ‘name’

@@ -520,7 +616,7 @@ title: Python Client API
-read_json(self: duckdb.DuckDBPyConnection, name: str, *, columns: Optional[object] = None, sample_size: Optional[object] = None, maximum_depth: Optional[object] = None, records: Optional[str] = None, format: Optional[str] = None) duckdb.DuckDBPyRelation +read_json(self: duckdb.duckdb.DuckDBPyConnection, name: str, *, columns: Optional[object] = None, sample_size: Optional[object] = None, maximum_depth: Optional[object] = None, records: Optional[str] = None, format: Optional[str] = None) duckdb.duckdb.DuckDBPyRelation

Create a relation object from the JSON file in ‘name’

@@ -529,16 +625,16 @@ title: Python Client API
-read_parquet(*args, **kwargs) +read_parquet(*args, **kwargs)

Overloaded function.

    -
  1. read_parquet(self: duckdb.DuckDBPyConnection, file_glob: str, binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None) -> duckdb.DuckDBPyRelation

  2. +
  3. read_parquet(self: duckdb.duckdb.DuckDBPyConnection, file_glob: str, binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None) -> duckdb.duckdb.DuckDBPyRelation

Create a relation object from the Parquet files in file_glob

    -
  1. read_parquet(self: duckdb.DuckDBPyConnection, file_globs: List[str], binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None) -> duckdb.DuckDBPyRelation

  2. +
  3. read_parquet(self: duckdb.duckdb.DuckDBPyConnection, file_globs: List[str], binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None) -> duckdb.duckdb.DuckDBPyRelation

Create a relation object from the Parquet files in file_globs

@@ -546,7 +642,7 @@ title: Python Client API
-register(self: duckdb.DuckDBPyConnection, view_name: str, python_object: object) duckdb.DuckDBPyConnection +register(self: duckdb.duckdb.DuckDBPyConnection, view_name: str, python_object: object) duckdb.duckdb.DuckDBPyConnection

Register the passed Python Object value for querying with a view

@@ -555,7 +651,7 @@ title: Python Client API
-register_filesystem(self: duckdb.DuckDBPyConnection, filesystem: fsspec.AbstractFileSystem) None +register_filesystem(self: duckdb.duckdb.DuckDBPyConnection, filesystem: fsspec.AbstractFileSystem) None

Register a fsspec compliant filesystem

@@ -564,7 +660,7 @@ title: Python Client API
-remove_function(self: duckdb.DuckDBPyConnection, name: str) duckdb.DuckDBPyConnection +remove_function(self: duckdb.duckdb.DuckDBPyConnection, name: str) duckdb.duckdb.DuckDBPyConnection

Remove a previously created function

@@ -573,7 +669,7 @@ title: Python Client API
-rollback(self: duckdb.DuckDBPyConnection) duckdb.DuckDBPyConnection +rollback(self: duckdb.duckdb.DuckDBPyConnection) duckdb.duckdb.DuckDBPyConnection

Roll back changes performed within a transaction

@@ -582,16 +678,25 @@ title: Python Client API
-row_type(self: duckdb.DuckDBPyConnection, fields: object) duckdb.typing.DuckDBPyType +row_type(self: duckdb.duckdb.DuckDBPyConnection, fields: object) duckdb.duckdb.typing.DuckDBPyType

Create a struct type object from ‘fields’

+
+
+property rowcount +
+
+

Get result set row count

+
+
+
-sql(self: duckdb.DuckDBPyConnection, query: str, alias: str = 'query_relation') duckdb.DuckDBPyRelation +sql(self: duckdb.duckdb.DuckDBPyConnection, query: str, *, alias: str = '', params: object = None) duckdb.duckdb.DuckDBPyRelation

Run a SQL query. If it is a SELECT statement, create a relation object from the given SQL query, otherwise run the query as-is.

@@ -600,7 +705,7 @@ title: Python Client API
-sqltype(self: duckdb.DuckDBPyConnection, type_str: str) duckdb.typing.DuckDBPyType +sqltype(self: duckdb.duckdb.DuckDBPyConnection, type_str: str) duckdb.duckdb.typing.DuckDBPyType

Create a type object by parsing the ‘type_str’ string

@@ -609,7 +714,7 @@ title: Python Client API
-string_type(self: duckdb.DuckDBPyConnection, collation: str = '') duckdb.typing.DuckDBPyType +string_type(self: duckdb.duckdb.DuckDBPyConnection, collation: str = '') duckdb.duckdb.typing.DuckDBPyType

Create a string type with an optional collation

@@ -618,7 +723,7 @@ title: Python Client API
-struct_type(self: duckdb.DuckDBPyConnection, fields: object) duckdb.typing.DuckDBPyType +struct_type(self: duckdb.duckdb.DuckDBPyConnection, fields: object) duckdb.duckdb.typing.DuckDBPyType

Create a struct type object from ‘fields’

@@ -627,7 +732,7 @@ title: Python Client API
-table(self: duckdb.DuckDBPyConnection, table_name: str) duckdb.DuckDBPyRelation +table(self: duckdb.duckdb.DuckDBPyConnection, table_name: str) duckdb.duckdb.DuckDBPyRelation

Create a relation object for the name’d table

@@ -636,7 +741,7 @@ title: Python Client API
-table_function(self: duckdb.DuckDBPyConnection, name: str, parameters: object = None) duckdb.DuckDBPyRelation +table_function(self: duckdb.duckdb.DuckDBPyConnection, name: str, parameters: object = None) duckdb.duckdb.DuckDBPyRelation

Create a relation object from the name’d table function with given parameters

@@ -645,7 +750,7 @@ title: Python Client API
-tf(self: duckdb.DuckDBPyConnection) dict +tf(self: duckdb.duckdb.DuckDBPyConnection) dict

Fetch a result as dict of TensorFlow Tensors following execute()

@@ -654,7 +759,7 @@ title: Python Client API
-torch(self: duckdb.DuckDBPyConnection) dict +torch(self: duckdb.duckdb.DuckDBPyConnection) dict

Fetch a result as dict of PyTorch Tensors following execute()

@@ -663,7 +768,7 @@ title: Python Client API
-type(self: duckdb.DuckDBPyConnection, type_str: str) duckdb.typing.DuckDBPyType +type(self: duckdb.duckdb.DuckDBPyConnection, type_str: str) duckdb.duckdb.typing.DuckDBPyType

Create a type object by parsing the ‘type_str’ string

@@ -672,7 +777,7 @@ title: Python Client API
-union_type(self: duckdb.DuckDBPyConnection, members: object) duckdb.typing.DuckDBPyType +union_type(self: duckdb.duckdb.DuckDBPyConnection, members: object) duckdb.duckdb.typing.DuckDBPyType

Create a union type object from ‘members’

@@ -681,7 +786,7 @@ title: Python Client API
-unregister(self: duckdb.DuckDBPyConnection, view_name: str) duckdb.DuckDBPyConnection +unregister(self: duckdb.duckdb.DuckDBPyConnection, view_name: str) duckdb.duckdb.DuckDBPyConnection

Unregister the view name

@@ -690,7 +795,7 @@ title: Python Client API
-unregister_filesystem(self: duckdb.DuckDBPyConnection, name: str) None +unregister_filesystem(self: duckdb.duckdb.DuckDBPyConnection, name: str) None

Unregister a filesystem

@@ -699,7 +804,7 @@ title: Python Client API
-values(self: duckdb.DuckDBPyConnection, values: object) duckdb.DuckDBPyRelation +values(self: duckdb.duckdb.DuckDBPyConnection, values: object) duckdb.duckdb.DuckDBPyRelation

Create a relation object from the passed values

@@ -708,7 +813,7 @@ title: Python Client API
-view(self: duckdb.DuckDBPyConnection, view_name: str) duckdb.DuckDBPyRelation +view(self: duckdb.duckdb.DuckDBPyConnection, view_name: str) duckdb.duckdb.DuckDBPyRelation

Create a relation object for the name’d view

@@ -720,22 +825,13 @@ title: Python Client API
-class duckdb.DuckDBPyRelation +class duckdb.DuckDBPyRelation

Bases: pybind11_object

-
-
-abs(self: duckdb.DuckDBPyRelation, aggregation_columns: str) duckdb.DuckDBPyRelation -
-
-

Returns the absolute value for the specified columns.

-
-
-
-aggregate(self: duckdb.DuckDBPyRelation, aggr_expr: str, group_expr: str = '') duckdb.DuckDBPyRelation +aggregate(self: duckdb.duckdb.DuckDBPyRelation, aggr_expr: str, group_expr: str = '') duckdb.duckdb.DuckDBPyRelation

Compute the aggregate aggr_expr by the optional groups group_expr on the relation

@@ -744,25 +840,52 @@ title: Python Client API
-property alias +property alias

Get the name of the current alias

+
+
+any_value(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Returns the first non-null value from a given column

+
+
+
-apply(self: duckdb.DuckDBPyRelation, function_name: str, function_aggr: str, group_expr: str = '', function_parameter: str = '', projected_columns: str = '') duckdb.DuckDBPyRelation +apply(self: duckdb.duckdb.DuckDBPyRelation, function_name: str, function_aggr: str, group_expr: str = '', function_parameter: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation

Compute the function of a single column or a list of columns by the optional groups on the relation

+
+
+arg_max(self: duckdb.duckdb.DuckDBPyRelation, arg_column: str, value_column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Finds the row with the maximum value for a value column and returns the value of that row for an argument column

+
+
+ +
+
+arg_min(self: duckdb.duckdb.DuckDBPyRelation, arg_column: str, value_column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Finds the row with the minimum value for a value column and returns the value of that row for an argument column

+
+
+
-arrow(self: duckdb.DuckDBPyRelation, batch_size: int = 1000000) pyarrow.lib.Table +arrow(self: duckdb.duckdb.DuckDBPyRelation, batch_size: int = 1000000) pyarrow.lib.Table

Execute and fetch all rows as an Arrow Table

@@ -770,89 +893,134 @@ title: Python Client API
-
-close(self: duckdb.DuckDBPyRelation) None +
+avg(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Closes the result

+

Computes the average on a given column

-
-
-property columns +
+
+bit_and(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Return a list containing the names of the columns of the relation.

+

Computes the bitwise AND of all bits present in a given column

-
-count(self: duckdb.DuckDBPyRelation, count_aggr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+bit_or(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Compute the aggregate count of a single column or a list of columns by the optional groups on the relation

+

Computes the bitwise OR of all bits present in a given column

-
-create(self: duckdb.DuckDBPyRelation, table_name: str) None +
+bit_xor(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Creates a new table named table_name with the contents of the relation object

+

Computes the bitwise XOR of all bits present in a given column

-
-create_view(self: duckdb.DuckDBPyRelation, view_name: str, replace: bool = True) duckdb.DuckDBPyRelation +
+bitstring_agg(self: duckdb.duckdb.DuckDBPyRelation, column: str, min: Optional[object] = None, max: Optional[object] = None, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Creates a view named view_name that refers to the relation object

+

Computes a bitstring with bits set for each distinct value in a given column

+
+
+ +
+
+bool_and(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Computes the logical AND of all values present in a given column

+
+
+ +
+
+bool_or(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Computes the logical OR of all values present in a given column

+
+
+ +
+
+close(self: duckdb.duckdb.DuckDBPyRelation) None +
+
+

Closes the result

+
+
+ +
+
+property columns +
+
+

Return a list containing the names of the columns of the relation.

+
+
+ +
+
+count(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Computes the number of elements present in a given column

-
-cummax(self: duckdb.DuckDBPyRelation, aggregation_columns: str) duckdb.DuckDBPyRelation +
+create(self: duckdb.duckdb.DuckDBPyRelation, table_name: str) None
-

Returns the cumulative maximum of the aggregate column.

+

Creates a new table named table_name with the contents of the relation object

-
-cummin(self: duckdb.DuckDBPyRelation, aggregation_columns: str) duckdb.DuckDBPyRelation +
+create_view(self: duckdb.duckdb.DuckDBPyRelation, view_name: str, replace: bool = True) duckdb.duckdb.DuckDBPyRelation
-

Returns the cumulative minimum of the aggregate column.

+

Creates a view named view_name that refers to the relation object

-
-cumprod(self: duckdb.DuckDBPyRelation, aggregation_columns: str) duckdb.DuckDBPyRelation +
+cume_dist(self: duckdb.duckdb.DuckDBPyRelation, window_spec: str, projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Returns the cumulative product of the aggregate column.

+

Computes the cumulative distribution within the partition

-
-cumsum(self: duckdb.DuckDBPyRelation, aggregation_columns: str) duckdb.DuckDBPyRelation +
+dense_rank(self: duckdb.duckdb.DuckDBPyRelation, window_spec: str, projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Returns the cumulative sum of the aggregate column.

+

Computes the dense rank within the partition

-describe(self: duckdb.DuckDBPyRelation) duckdb.DuckDBPyRelation +describe(self: duckdb.duckdb.DuckDBPyRelation) duckdb.duckdb.DuckDBPyRelation

Gives basic statistics (e.g., min,max) and if null exists for each column of the relation.

@@ -861,7 +1029,7 @@ title: Python Client API
-property description +property description

Return the description of the result

@@ -870,7 +1038,7 @@ title: Python Client API
-df(self: duckdb.DuckDBPyRelation, *, date_as_object: bool = False) pandas.DataFrame +df(self: duckdb.duckdb.DuckDBPyRelation, *, date_as_object: bool = False) pandas.DataFrame

Execute and fetch all rows as a pandas DataFrame

@@ -879,7 +1047,7 @@ title: Python Client API
-distinct(self: duckdb.DuckDBPyRelation) duckdb.DuckDBPyRelation +distinct(self: duckdb.duckdb.DuckDBPyRelation) duckdb.duckdb.DuckDBPyRelation

Retrieve distinct rows from this relation object

@@ -888,7 +1056,7 @@ title: Python Client API
-property dtypes +property dtypes

Return a list containing the types of the columns of the relation.

@@ -897,7 +1065,7 @@ title: Python Client API
-except_(self: duckdb.DuckDBPyRelation, other_rel: duckdb.DuckDBPyRelation) duckdb.DuckDBPyRelation +except_(self: duckdb.duckdb.DuckDBPyRelation, other_rel: duckdb.duckdb.DuckDBPyRelation) duckdb.duckdb.DuckDBPyRelation

Create the set except of this relation object with another relation object in other_rel

@@ -906,7 +1074,7 @@ title: Python Client API
-execute(self: duckdb.DuckDBPyRelation) duckdb.DuckDBPyRelation +execute(self: duckdb.duckdb.DuckDBPyRelation) duckdb.duckdb.DuckDBPyRelation

Transform the relation into a result set

@@ -915,14 +1083,23 @@ title: Python Client API
-explain(self: duckdb.DuckDBPyRelation, type: duckdb.ExplainType = 'standard') str +explain(self: duckdb.duckdb.DuckDBPyRelation, type: duckdb.duckdb.ExplainType = 'standard') str
+
+
+favg(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Computes the average of all values present in a given column using a more accurate floating point summation (Kahan Sum)

+
+
+
-fetch_arrow_reader(self: duckdb.DuckDBPyRelation, batch_size: int = 1000000) pyarrow.lib.RecordBatchReader +fetch_arrow_reader(self: duckdb.duckdb.DuckDBPyRelation, batch_size: int = 1000000) pyarrow.lib.RecordBatchReader

Execute and return an Arrow Record Batch Reader that yields all rows

@@ -931,7 +1108,7 @@ title: Python Client API
-fetch_arrow_table(self: duckdb.DuckDBPyRelation, batch_size: int = 1000000) pyarrow.lib.Table +fetch_arrow_table(self: duckdb.duckdb.DuckDBPyRelation, batch_size: int = 1000000) pyarrow.lib.Table

Execute and fetch all rows as an Arrow Table

@@ -940,7 +1117,7 @@ title: Python Client API
-fetchall(self: duckdb.DuckDBPyRelation) list +fetchall(self: duckdb.duckdb.DuckDBPyRelation) list

Execute and fetch all rows as a list of tuples

@@ -949,7 +1126,7 @@ title: Python Client API
-fetchdf(self: duckdb.DuckDBPyRelation, *, date_as_object: bool = False) pandas.DataFrame +fetchdf(self: duckdb.duckdb.DuckDBPyRelation, *, date_as_object: bool = False) pandas.DataFrame

Execute and fetch all rows as a pandas DataFrame

@@ -958,7 +1135,7 @@ title: Python Client API
-fetchmany(self: duckdb.DuckDBPyRelation, size: int = 1) list +fetchmany(self: duckdb.duckdb.DuckDBPyRelation, size: int = 1) list

Execute and fetch the next set of rows as a list of tuples

@@ -967,7 +1144,7 @@ title: Python Client API
-fetchnumpy(self: duckdb.DuckDBPyRelation) dict +fetchnumpy(self: duckdb.duckdb.DuckDBPyRelation) dict

Execute and fetch all rows as a Python dict mapping each column to one numpy arrays

@@ -976,7 +1153,7 @@ title: Python Client API
-fetchone(self: duckdb.DuckDBPyRelation) Optional[tuple] +fetchone(self: duckdb.duckdb.DuckDBPyRelation) Optional[tuple]

Execute and fetch a single row as a tuple

@@ -985,7 +1162,7 @@ title: Python Client API
-filter(self: duckdb.DuckDBPyRelation, filter_expr: str) duckdb.DuckDBPyRelation +filter(self: duckdb.duckdb.DuckDBPyRelation, filter_expr: object) duckdb.duckdb.DuckDBPyRelation

Filter the relation object by the filter in filter_expr

@@ -993,368 +1170,548 @@ title: Python Client API
-
-insert(self: duckdb.DuckDBPyRelation, values: object) None +
+first(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Inserts the given values into the relation

+

Returns the first value of a given column

-
-insert_into(self: duckdb.DuckDBPyRelation, table_name: str) None +
+first_value(self: duckdb.duckdb.DuckDBPyRelation, column: str, window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Inserts the relation object into an existing table named table_name

+

Computes the first value within the group or partition

-
-intersect(self: duckdb.DuckDBPyRelation, other_rel: duckdb.DuckDBPyRelation) duckdb.DuckDBPyRelation +
+fsum(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Create the set intersection of this relation object with another relation object in other_rel

+

Computes the sum of all values present in a given column using a more accurate floating point summation (Kahan Sum)

-
-join(self: duckdb.DuckDBPyRelation, other_rel: duckdb.DuckDBPyRelation, condition: str, how: str = 'inner') duckdb.DuckDBPyRelation +
+geomean(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Join the relation object with another relation object in other_rel using the join condition expression in join_condition. Types supported are ‘inner’ and ‘left’

+

Computes the geometric mean over all values present in a given column

-
-kurt(self: duckdb.DuckDBPyRelation, aggregation_columns: str, group_columns: str = '') duckdb.DuckDBPyRelation +
+histogram(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Returns the excess kurtosis of the aggregate column.

+

Computes the histogram over all values present in a given column

-
-limit(self: duckdb.DuckDBPyRelation, n: int, offset: int = 0) duckdb.DuckDBPyRelation +
+insert(self: duckdb.duckdb.DuckDBPyRelation, values: object) None
-

Only retrieve the first n rows from this relation object, starting at offset

+

Inserts the given values into the relation

-
-mad(self: duckdb.DuckDBPyRelation, aggregation_columns: str, group_columns: str = '') duckdb.DuckDBPyRelation +
+insert_into(self: duckdb.duckdb.DuckDBPyRelation, table_name: str) None
-

Returns the median absolute deviation for the aggregate columns. NULL values are ignored. Temporal types return a positive INTERVAL.

+

Inserts the relation object into an existing table named table_name

-
-map(self: duckdb.DuckDBPyRelation, map_function: function, *, schema: Optional[object] = None) duckdb.DuckDBPyRelation +
+intersect(self: duckdb.duckdb.DuckDBPyRelation, other_rel: duckdb.duckdb.DuckDBPyRelation) duckdb.duckdb.DuckDBPyRelation
-

Calls the passed function on the relation

+

Create the set intersection of this relation object with another relation object in other_rel

-
-max(self: duckdb.DuckDBPyRelation, max_aggr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+join(self: duckdb.duckdb.DuckDBPyRelation, other_rel: duckdb.duckdb.DuckDBPyRelation, condition: object, how: str = 'inner') duckdb.duckdb.DuckDBPyRelation
-

Compute the aggregate max of a single column or a list of columns by the optional groups on the relation

+

Join the relation object with another relation object in other_rel using the join condition expression in join_condition. Types supported are ‘inner’ and ‘left’

-
-mean(self: duckdb.DuckDBPyRelation, mean_aggr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+lag(self: duckdb.duckdb.DuckDBPyRelation, column: str, window_spec: str, offset: int = 1, default_value: str = 'NULL', ignore_nulls: bool = False, projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Compute the aggregate mean of a single column or a list of columns by the optional groups on the relation

+

Computes the lag within the partition

-
-median(self: duckdb.DuckDBPyRelation, median_aggr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+last(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Compute the aggregate median of a single column or a list of columns by the optional groups on the relation

+

Returns the last value of a given column

-
-min(self: duckdb.DuckDBPyRelation, min_aggr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+last_value(self: duckdb.duckdb.DuckDBPyRelation, column: str, window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Compute the aggregate min of a single column or a list of columns by the optional groups on the relation

+

Computes the last value within the group or partition

-
-mode(self: duckdb.DuckDBPyRelation, aggregation_columns: str, group_columns: str = '') duckdb.DuckDBPyRelation +
+lead(self: duckdb.duckdb.DuckDBPyRelation, column: str, window_spec: str, offset: int = 1, default_value: str = 'NULL', ignore_nulls: bool = False, projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Returns the most frequent value for the aggregate columns. NULL values are ignored.

+

Computes the lead within the partition

-
-order(self: duckdb.DuckDBPyRelation, order_expr: str) duckdb.DuckDBPyRelation +
+limit(self: duckdb.duckdb.DuckDBPyRelation, n: int, offset: int = 0) duckdb.duckdb.DuckDBPyRelation
-

Reorder the relation object by order_expr

+

Only retrieve the first n rows from this relation object, starting at offset

-
-pl(self: duckdb.DuckDBPyRelation, batch_size: int = 1000000) duckdb::PolarsDataFrame +
+list(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Execute and fetch all rows as a Polars DataFrame

+

Returns a list containing all values present in a given column

-
-prod(self: duckdb.DuckDBPyRelation, aggregation_columns: str, group_columns: str = '') duckdb.DuckDBPyRelation +
+map(self: duckdb.duckdb.DuckDBPyRelation, map_function: function, *, schema: Optional[object] = None) duckdb.duckdb.DuckDBPyRelation
-

Calculates the product of the aggregate column.

+

Calls the passed function on the relation

-
-project(self: duckdb.DuckDBPyRelation, project_expr: str) duckdb.DuckDBPyRelation +
+max(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Project the relation object by the projection in project_expr

+

Returns the maximum value present in a given column

-
-quantile(self: duckdb.DuckDBPyRelation, q: str, quantile_aggr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+mean(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Compute the quantile of a single column or a list of columns by the optional groups on the relation

+

Computes the average on a given column

-
-query(self: duckdb.DuckDBPyRelation, virtual_table_name: str, sql_query: str) duckdb.DuckDBPyRelation +
+median(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Run the given SQL query in sql_query on the view named virtual_table_name that refers to the relation object

+

Computes the median over all values present in a given column

-
-record_batch(self: duckdb.DuckDBPyRelation, batch_size: int = 1000000) pyarrow.lib.RecordBatchReader +
+min(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Execute and return an Arrow Record Batch Reader that yields all rows

+

Returns the minimum value present in a given column

-
-select_dtypes(self: duckdb.DuckDBPyRelation, types: object) duckdb.DuckDBPyRelation +
+mode(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Select columns from the relation, by filtering based on type(s)

+

Computes the mode over all values present in a given column

-
-select_types(self: duckdb.DuckDBPyRelation, types: object) duckdb.DuckDBPyRelation +
+n_tile(self: duckdb.duckdb.DuckDBPyRelation, window_spec: str, num_buckets: int, projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Select columns from the relation, by filtering based on type(s)

+

Divides the partition as equally as possible into num_buckets

-
-sem(self: duckdb.DuckDBPyRelation, aggregation_columns: str, group_columns: str = '') duckdb.DuckDBPyRelation +
+nth_value(self: duckdb.duckdb.DuckDBPyRelation, column: str, window_spec: str, offset: int, ignore_nulls: bool = False, projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Returns the standard error of the mean of the aggregate column.

+

Computes the nth value within the partition

-
-set_alias(self: duckdb.DuckDBPyRelation, alias: str) duckdb.DuckDBPyRelation +
+order(self: duckdb.duckdb.DuckDBPyRelation, order_expr: str) duckdb.duckdb.DuckDBPyRelation
-

Rename the relation object to new alias

+

Reorder the relation object by order_expr

-
-
-property shape +
+
+percent_rank(self: duckdb.duckdb.DuckDBPyRelation, window_spec: str, projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Tuple of # of rows, # of columns in relation.

+

Computes the relative rank within the partition

-
-show(self: duckdb.DuckDBPyRelation) None +
+pl(self: duckdb.duckdb.DuckDBPyRelation, batch_size: int = 1000000) duckdb::PolarsDataFrame
-

Display a summary of the data

+

Execute and fetch all rows as a Polars DataFrame

-
-skew(self: duckdb.DuckDBPyRelation, aggregation_columns: str, group_columns: str = '') duckdb.DuckDBPyRelation +
+product(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Returns the skewness of the aggregate column.

+

Returns the product of all values present in a given column

-
-sql_query(self: duckdb.DuckDBPyRelation) str +
+project(self: duckdb.duckdb.DuckDBPyRelation, *args, **kwargs) duckdb.duckdb.DuckDBPyRelation
-

Get the SQL query that is equivalent to the relation

+

Project the relation object by the projection in project_expr

-
-std(self: duckdb.DuckDBPyRelation, std_aggr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+quantile(self: duckdb.duckdb.DuckDBPyRelation, column: str, q: object = 0.5, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Compute the standard deviation of a single column or a list of columns by the optional groups on the relation

+

Computes the exact quantile value for a given column

-
-sum(self: duckdb.DuckDBPyRelation, sum_aggr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+quantile_cont(self: duckdb.duckdb.DuckDBPyRelation, column: str, q: object = 0.5, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Compute the aggregate sum of a single column or a list of columns by the optional groups on the relation

+

Computes the interpolated quantile value for a given column

-
-tf(self: duckdb.DuckDBPyRelation) dict +
+quantile_disc(self: duckdb.duckdb.DuckDBPyRelation, column: str, q: object = 0.5, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Fetch a result as dict of TensorFlow Tensors

+

Computes the exact quantile value for a given column

-
-to_arrow_table(self: duckdb.DuckDBPyRelation, batch_size: int = 1000000) pyarrow.lib.Table +
+query(self: duckdb.duckdb.DuckDBPyRelation, virtual_table_name: str, sql_query: str) duckdb.duckdb.DuckDBPyRelation
-

Execute and fetch all rows as an Arrow Table

+

Run the given SQL query in sql_query on the view named virtual_table_name that refers to the relation object

-
-to_csv(self: duckdb.DuckDBPyRelation, file_name: str, *, sep: object = None, na_rep: object = None, header: object = None, quotechar: object = None, escapechar: object = None, date_format: object = None, timestamp_format: object = None, quoting: object = None, encoding: object = None, compression: object = None) None +
+rank(self: duckdb.duckdb.DuckDBPyRelation, window_spec: str, projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Write the relation object to a CSV file in ‘file_name’

+

Computes the rank within the partition

-
-to_df(self: duckdb.DuckDBPyRelation, *, date_as_object: bool = False) pandas.DataFrame +
+rank_dense(self: duckdb.duckdb.DuckDBPyRelation, window_spec: str, projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Execute and fetch all rows as a pandas DataFrame

+

Computes the dense rank within the partition

-
-to_parquet(self: duckdb.DuckDBPyRelation, file_name: str, *, compression: object = None) None +
+record_batch(self: duckdb.duckdb.DuckDBPyRelation, batch_size: int = 1000000) pyarrow.lib.RecordBatchReader
-

Write the relation object to a Parquet file in ‘file_name’

+

Execute and return an Arrow Record Batch Reader that yields all rows

-
-to_table(self: duckdb.DuckDBPyRelation, table_name: str) None +
+row_number(self: duckdb.duckdb.DuckDBPyRelation, window_spec: str, projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Creates a new table named table_name with the contents of the relation object

+

Computes the row number within the partition

-
-to_view(self: duckdb.DuckDBPyRelation, view_name: str, replace: bool = True) duckdb.DuckDBPyRelation +
+select(self: duckdb.duckdb.DuckDBPyRelation, *args, **kwargs) duckdb.duckdb.DuckDBPyRelation
-

Creates a view named view_name that refers to the relation object

+

Project the relation object by the projection in project_expr

-
-torch(self: duckdb.DuckDBPyRelation) dict +
+select_dtypes(self: duckdb.duckdb.DuckDBPyRelation, types: object) duckdb.duckdb.DuckDBPyRelation
-

Fetch a result as dict of PyTorch Tensors

+

Select columns from the relation, by filtering based on type(s)

-
-
-property type +
+
+select_types(self: duckdb.duckdb.DuckDBPyRelation, types: object) duckdb.duckdb.DuckDBPyRelation
-

Get the type of the relation.

+

Select columns from the relation, by filtering based on type(s)

-
-
-property types +
+
+set_alias(self: duckdb.duckdb.DuckDBPyRelation, alias: str) duckdb.duckdb.DuckDBPyRelation
-

Return a list containing the types of the columns of the relation.

+

Rename the relation object to new alias

-
+
+
+property shape +
+
+

Tuple of # of rows, # of columns in relation.

+
+
+ +
+
+show(self: duckdb.duckdb.DuckDBPyRelation, *, max_width: Optional[int] = None, max_rows: Optional[int] = None, max_col_width: Optional[int] = None, null_value: Optional[str] = None, render_mode: object = None) None +
+
+

Display a summary of the data

+
+
+ +
+
+sort(self: duckdb.duckdb.DuckDBPyRelation, *args) duckdb.duckdb.DuckDBPyRelation +
+
+

Reorder the relation object by the provided expressions

+
+
+ +
+
+sql_query(self: duckdb.duckdb.DuckDBPyRelation) str +
+
+

Get the SQL query that is equivalent to the relation

+
+
+ +
+
+std(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Computes the sample standard deviation for a given column

+
+
+ +
+
+stddev(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Computes the sample standard deviation for a given column

+
+
+ +
+
+stddev_pop(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Computes the population standard deviation for a given column

+
+
+ +
+
+stddev_samp(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Computes the sample standard deviation for a given column

+
+
+ +
+
+string_agg(self: duckdb.duckdb.DuckDBPyRelation, column: str, sep: str = ',', groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Concatenates the values present in a given column with a separator

+
+
+ +
+
+sum(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Computes the sum of all values present in a given column

+
+
+ +
+
+tf(self: duckdb.duckdb.DuckDBPyRelation) dict +
+
+

Fetch a result as dict of TensorFlow Tensors

+
+
+ +
+
+to_arrow_table(self: duckdb.duckdb.DuckDBPyRelation, batch_size: int = 1000000) pyarrow.lib.Table +
+
+

Execute and fetch all rows as an Arrow Table

+
+
+ +
+
+to_csv(self: duckdb.duckdb.DuckDBPyRelation, file_name: str, *, sep: object = None, na_rep: object = None, header: object = None, quotechar: object = None, escapechar: object = None, date_format: object = None, timestamp_format: object = None, quoting: object = None, encoding: object = None, compression: object = None) None +
+
+

Write the relation object to a CSV file in ‘file_name’

+
+
+ +
+
+to_df(self: duckdb.duckdb.DuckDBPyRelation, *, date_as_object: bool = False) pandas.DataFrame +
+
+

Execute and fetch all rows as a pandas DataFrame

+
+
+ +
+
+to_parquet(self: duckdb.duckdb.DuckDBPyRelation, file_name: str, *, compression: object = None) None +
+
+

Write the relation object to a Parquet file in ‘file_name’

+
+
+ +
+
+to_table(self: duckdb.duckdb.DuckDBPyRelation, table_name: str) None +
+
+

Creates a new table named table_name with the contents of the relation object

+
+
+ +
+
+to_view(self: duckdb.duckdb.DuckDBPyRelation, view_name: str, replace: bool = True) duckdb.duckdb.DuckDBPyRelation +
+
+

Creates a view named view_name that refers to the relation object

+
+
+ +
+
+torch(self: duckdb.duckdb.DuckDBPyRelation) dict +
+
+

Fetch a result as dict of PyTorch Tensors

+
+
+ +
+
+property type +
+
+

Get the type of the relation.

+
+
+ +
+
+property types +
+
+

Return a list containing the types of the columns of the relation.

+
+
+ +
-union(self: duckdb.DuckDBPyRelation, union_rel: duckdb.DuckDBPyRelation) duckdb.DuckDBPyRelation +union(self: duckdb.duckdb.DuckDBPyRelation, union_rel: duckdb.duckdb.DuckDBPyRelation) duckdb.duckdb.DuckDBPyRelation

Create the set union of this relation object with another relation object in other_rel

@@ -1363,7 +1720,7 @@ title: Python Client API
-unique(self: duckdb.DuckDBPyRelation, unique_aggr: str) duckdb.DuckDBPyRelation +unique(self: duckdb.duckdb.DuckDBPyRelation, unique_aggr: str) duckdb.duckdb.DuckDBPyRelation

Number of distinct values in a column.

@@ -1371,26 +1728,44 @@ title: Python Client API
-
-value_counts(self: duckdb.DuckDBPyRelation, value_counts_aggr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+var(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Count number of rows with each unique value of variable

+

Computes the sample variance for a given column

-
-var(self: duckdb.DuckDBPyRelation, var_aggr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+var_pop(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Computes the population variance for a given column

+
+
+ +
+
+var_samp(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Computes the sample variance for a given column

+
+
+ +
+
+variance(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Compute the variance of a single column or a list of columns by the optional groups on the relation

+

Computes the sample variance for a given column

-write_csv(self: duckdb.DuckDBPyRelation, file_name: str, *, sep: object = None, na_rep: object = None, header: object = None, quotechar: object = None, escapechar: object = None, date_format: object = None, timestamp_format: object = None, quoting: object = None, encoding: object = None, compression: object = None) None +write_csv(self: duckdb.duckdb.DuckDBPyRelation, file_name: str, *, sep: object = None, na_rep: object = None, header: object = None, quotechar: object = None, escapechar: object = None, date_format: object = None, timestamp_format: object = None, quoting: object = None, encoding: object = None, compression: object = None) None

Write the relation object to a CSV file in ‘file_name’

@@ -1399,7 +1774,7 @@ title: Python Client API
-write_parquet(self: duckdb.DuckDBPyRelation, file_name: str, *, compression: object = None) None +write_parquet(self: duckdb.duckdb.DuckDBPyRelation, file_name: str, *, compression: object = None) None

Write the relation object to a Parquet file in ‘file_name’

@@ -1411,7 +1786,7 @@ title: Python Client API
-exception duckdb.Error +exception duckdb.Error

Bases: Exception

@@ -1420,7 +1795,7 @@ title: Python Client API
-class duckdb.ExplainType +class duckdb.ExplainType

Bases: pybind11_object

@@ -1429,28 +1804,28 @@ title: Python Client API

ANALYZE

-ANALYZE = <ExplainType.ANALYZE: 1> +ANALYZE = <ExplainType.ANALYZE: 1>
-STANDARD = <ExplainType.STANDARD: 0> +STANDARD = <ExplainType.STANDARD: 0>
-property name +property name
-property value +property value
@@ -1458,46 +1833,223 @@ title: Python Client API
+
+
+class duckdb.Expression +
+
+

Bases: pybind11_object

+
+
+alias(self: duckdb.duckdb.Expression, arg0: str) duckdb.duckdb.Expression +
+
+

Create a copy of this expression with the given alias.

+
+
Parameters:
+
+

name: The alias to use for the expression, this will affect how it can be referenced.

+
+
Returns:
+
+

Expression: self with an alias.

+
+
+
+
+ +
+
+asc(self: duckdb.duckdb.Expression) duckdb.duckdb.Expression +
+
+

Set the order by modifier to ASCENDING.

+
+
+ +
+
+cast(self: duckdb.duckdb.Expression, type: duckdb.duckdb.typing.DuckDBPyType) duckdb.duckdb.Expression +
+
+

Create a CastExpression to type from self

+
+
Parameters:
+
+

type: The type to cast to

+
+
Returns:
+
+

CastExpression: self::type

+
+
+
+
+ +
+
+desc(self: duckdb.duckdb.Expression) duckdb.duckdb.Expression +
+
+

Set the order by modifier to DESCENDING.

+
+
+ +
+
+isin(self: duckdb.duckdb.Expression, *args) duckdb.duckdb.Expression +
+
+

Return a IN expression comparing self to the input arguments.

+
+
Returns:
+
+

DuckDBPyExpression: The compare IN expression

+
+
+
+
+ +
+
+isnotin(self: duckdb.duckdb.Expression, *args) duckdb.duckdb.Expression +
+
+

Return a NOT IN expression comparing self to the input arguments.

+
+
Returns:
+
+

DuckDBPyExpression: The compare NOT IN expression

+
+
+
+
+ +
+
+nulls_first(self: duckdb.duckdb.Expression) duckdb.duckdb.Expression +
+
+

Set the NULL order by modifier to NULLS FIRST.

+
+
+ +
+
+nulls_last(self: duckdb.duckdb.Expression) duckdb.duckdb.Expression +
+
+

Set the NULL order by modifier to NULLS LAST.

+
+
+ +
+
+otherwise(self: duckdb.duckdb.Expression, value: duckdb.duckdb.Expression) duckdb.duckdb.Expression +
+
+

Add an ELSE <value> clause to the CaseExpression.

+
+
Parameters:
+
+

value: The value to use if none of the WHEN conditions are met.

+
+
Returns:
+
+

CaseExpression: self with an ELSE clause.

+
+
+
+
+ +
+
+show(self: duckdb.duckdb.Expression) None +
+
+

Print the stringified version of the expression.

+
+
+ +
+
+when(self: duckdb.duckdb.Expression, condition: duckdb.duckdb.Expression, value: duckdb.duckdb.Expression) duckdb.duckdb.Expression +
+
+

Add an additional WHEN <condition> THEN <value> clause to the CaseExpression.

+
+
Parameters:
+
+

condition: The condition that must be met. +value: The value to use if the condition is met.

+
+
Returns:
+
+

CaseExpression: self with an additional WHEN clause.

+
+
+
+
+ +
+
+
-exception duckdb.FatalException +exception duckdb.FatalException
-

Bases: Error

+

Bases: Error

+
+
+class duckdb.FloatValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+duckdb.FunctionExpression(function_name: str, *args) duckdb.duckdb.Expression +
+
+
+
-exception duckdb.HTTPException +exception duckdb.HTTPException
-

Bases: IOException

+

Bases: IOException

Thrown when an error occurs in the httpfs extension, or whilst downloading an extension.

-body: str +body: str
-headers: Dict[str, str] +headers: Dict[str, str]
-reason: str +reason: str
-status_code: int +status_code: int
@@ -1505,144 +2057,189 @@ title: Python Client API
+
+
+class duckdb.HugeIntegerValue(object: Any) +
+
+

Bases: Value

+
+
+
-exception duckdb.IOException +exception duckdb.IOException
-

Bases: OperationalError

+

Bases: OperationalError

+
+
+ +
+
+class duckdb.IntegerValue(object: Any) +
+
+

Bases: Value

-exception duckdb.IntegrityError +exception duckdb.IntegrityError
-

Bases: Error

+

Bases: Error

-exception duckdb.InternalError +exception duckdb.InternalError
-

Bases: Error

+

Bases: Error

-exception duckdb.InternalException +exception duckdb.InternalException
-

Bases: InternalError

+

Bases: InternalError

-exception duckdb.InterruptException +exception duckdb.InterruptException
-

Bases: Error

+

Bases: Error

+
+
+ +
+
+class duckdb.IntervalValue(object: Any) +
+
+

Bases: Value

-exception duckdb.InvalidInputException +exception duckdb.InvalidInputException
-

Bases: ProgrammingError

+

Bases: ProgrammingError

-exception duckdb.InvalidTypeException +exception duckdb.InvalidTypeException
-

Bases: ProgrammingError

+

Bases: ProgrammingError

+
+
+ +
+
+class duckdb.LongValue(object: Any) +
+
+

Bases: Value

-exception duckdb.NotImplementedException +exception duckdb.NotImplementedException
-

Bases: NotSupportedError

+

Bases: NotSupportedError

-exception duckdb.NotSupportedError +exception duckdb.NotSupportedError
-

Bases: Error

+

Bases: Error

+
+
+ +
+
+class duckdb.NullValue +
+
+

Bases: Value

-exception duckdb.OperationalError +exception duckdb.OperationalError
-

Bases: Error

+

Bases: Error

-exception duckdb.OutOfMemoryException +exception duckdb.OutOfMemoryException
-

Bases: OperationalError

+

Bases: OperationalError

-exception duckdb.OutOfRangeException +exception duckdb.OutOfRangeException
-

Bases: DataError

+

Bases: DataError

-exception duckdb.ParserException +exception duckdb.ParserException
-

Bases: ProgrammingError

+

Bases: ProgrammingError

-exception duckdb.PermissionException +exception duckdb.PermissionException
-

Bases: Error

+

Bases: Error

-exception duckdb.ProgrammingError +exception duckdb.ProgrammingError
-

Bases: Error

+

Bases: Error

-class duckdb.PythonExceptionHandling +class duckdb.PythonExceptionHandling

Bases: pybind11_object

@@ -1651,28 +2248,28 @@ title: Python Client API

RETURN_NULL

-DEFAULT = <PythonExceptionHandling.DEFAULT: 0> +DEFAULT = <PythonExceptionHandling.DEFAULT: 0>
-RETURN_NULL = <PythonExceptionHandling.RETURN_NULL: 1> +RETURN_NULL = <PythonExceptionHandling.RETURN_NULL: 1>
-property name +property name
-property value +property value
@@ -1682,70 +2279,218 @@ title: Python Client API
-exception duckdb.SequenceException +exception duckdb.SequenceException
-

Bases: Error

+

Bases: Error

-exception duckdb.SerializationException +exception duckdb.SerializationException +
+
+

Bases: OperationalError

+
+
+ +
+
+class duckdb.ShortValue(object: Any)
-

Bases: OperationalError

+

Bases: Value

-exception duckdb.StandardException +exception duckdb.StandardException
-

Bases: Error

+

Bases: Error

+
+
+ +
+
+duckdb.StarExpression(*args, **kwargs) +
+
+

Overloaded function.

+
    +
  1. StarExpression(*, exclude: list = []) -> duckdb.duckdb.Expression

  2. +
  3. StarExpression() -> duckdb.duckdb.Expression

  4. +
+
+
+ +
+
+class duckdb.StringValue(object: Any) +
+
+

Bases: Value

-exception duckdb.SyntaxException +exception duckdb.SyntaxException +
+
+

Bases: ProgrammingError

+
+
+ +
+
+class duckdb.TimeTimeZoneValue(object: Any)
-

Bases: ProgrammingError

+

Bases: Value

+
+
+ +
+
+class duckdb.TimeValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.TimestampMilisecondValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.TimestampNanosecondValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.TimestampSecondValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.TimestampTimeZoneValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.TimestampValue(object: Any) +
+
+

Bases: Value

-exception duckdb.TransactionException +exception duckdb.TransactionException
-

Bases: OperationalError

+

Bases: OperationalError

-exception duckdb.TypeMismatchException +exception duckdb.TypeMismatchException +
+
+

Bases: DataError

+
+
+ +
+
+class duckdb.UUIDValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.UnsignedBinaryValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.UnsignedIntegerValue(object: Any)
-

Bases: DataError

+

Bases: Value

+
+
+ +
+
+class duckdb.UnsignedLongValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.UnsignedShortValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.Value(object: Any, type: DuckDBPyType) +
+
+

Bases: object

-exception duckdb.ValueOutOfRangeException +exception duckdb.ValueOutOfRangeException
-

Bases: DataError

+

Bases: DataError

-exception duckdb.Warning +exception duckdb.Warning

Bases: Exception

@@ -1754,7 +2499,7 @@ title: Python Client API
-duckdb.aggregate(df: pandas.DataFrame, aggr_expr: str, group_expr: str = '', connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +duckdb.aggregate(df: pandas.DataFrame, aggr_expr: str, group_expr: str = '', connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation

Compute the aggregate aggr_expr by the optional groups group_expr on DataFrame df

@@ -1763,7 +2508,7 @@ title: Python Client API
-duckdb.alias(df: pandas.DataFrame, alias: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +duckdb.alias(df: pandas.DataFrame, alias: str, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation

Create a relation from DataFrame df with the passed alias

@@ -1772,7 +2517,7 @@ title: Python Client API
-duckdb.append(table_name: str, df: pandas.DataFrame, *, by_name: bool = False, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +duckdb.append(table_name: str, df: pandas.DataFrame, *, by_name: bool = False, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection

Append the passed DataFrame to the named table

@@ -1781,7 +2526,7 @@ title: Python Client API
-duckdb.array_type(type: duckdb.typing.DuckDBPyType, connection: duckdb.DuckDBPyConnection = None) duckdb.typing.DuckDBPyType +duckdb.array_type(type: duckdb.duckdb.typing.DuckDBPyType, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType

Create an array type object of ‘type’

@@ -1790,7 +2535,7 @@ title: Python Client API
-duckdb.arrow(*args, **kwargs) +duckdb.arrow(*args, **kwargs)

Overloaded function.

@@ -1799,7 +2544,7 @@ title: Python Client API

Fetch a result as Arrow table following execute()

    -
  1. arrow(arrow_object: object, connection: duckdb.DuckDBPyConnection = None) -> duckdb.DuckDBPyRelation

  2. +
  3. arrow(arrow_object: object, connection: duckdb.DuckDBPyConnection = None) -> duckdb.duckdb.DuckDBPyRelation

Create a relation object from an Arrow object

@@ -1807,7 +2552,7 @@ title: Python Client API
-duckdb.begin(connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +duckdb.begin(connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection

Start a new transaction

@@ -1816,7 +2561,7 @@ title: Python Client API
-duckdb.close(connection: duckdb.DuckDBPyConnection = None) None +duckdb.close(connection: duckdb.DuckDBPyConnection = None) None

Close the connection

@@ -1825,7 +2570,7 @@ title: Python Client API
-duckdb.commit(connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +duckdb.commit(connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection

Commit changes performed within a transaction

@@ -1834,7 +2579,7 @@ title: Python Client API
-duckdb.connect(database: str = ':memory:', read_only: bool = False, config: dict = None) duckdb.DuckDBPyConnection +duckdb.connect(database: str = ':memory:', read_only: bool = False, config: dict = None) duckdb.DuckDBPyConnection

Create a DuckDB database instance. Can take a database file name to read/write persistent data and a read_only flag if no changes are desired

@@ -1843,7 +2588,7 @@ title: Python Client API
-duckdb.create_function(name: str, function: function, return_type: object = None, parameters: duckdb.typing.DuckDBPyType = None, *, type: duckdb.functional.PythonUDFType = <PythonUDFType.NATIVE: 0>, null_handling: duckdb.functional.FunctionNullHandling = 0, exception_handling: duckdb.PythonExceptionHandling = 0, side_effects: bool = False, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +duckdb.create_function(name: str, function: function, return_type: object = None, parameters: duckdb.duckdb.typing.DuckDBPyType = None, *, type: duckdb.duckdb.functional.PythonUDFType = <PythonUDFType.NATIVE: 0>, null_handling: duckdb.duckdb.functional.FunctionNullHandling = 0, exception_handling: duckdb.duckdb.PythonExceptionHandling = 0, side_effects: bool = False, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection

Create a DuckDB function out of the passing in python function so it can be used in queries

@@ -1852,7 +2597,7 @@ title: Python Client API
-duckdb.cursor(connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +duckdb.cursor(connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection

Create a duplicate of the current connection

@@ -1861,7 +2606,7 @@ title: Python Client API
-duckdb.decimal_type(width: int, scale: int, connection: duckdb.DuckDBPyConnection = None) duckdb.typing.DuckDBPyType +duckdb.decimal_type(width: int, scale: int, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType

Create a decimal type with ‘width’ and ‘scale’

@@ -1870,7 +2615,7 @@ title: Python Client API
-duckdb.description(connection: duckdb.DuckDBPyConnection = None) Optional[list] +duckdb.description(connection: duckdb.DuckDBPyConnection = None) Optional[list]

Get result set attributes, mainly column names

@@ -1879,16 +2624,16 @@ title: Python Client API
-duckdb.df(*args, **kwargs) +duckdb.df(*args, **kwargs)

Overloaded function.

    -
  1. df(*, date_as_object: bool = False, connection: duckdb.DuckDBPyConnection = None) -> pandas.DataFrame

  2. +
  3. df(*, date_as_object: bool = False, connection: duckdb.DuckDBPyConnection = None) -> pandas.DataFrame

Fetch a result as DataFrame following execute()

    -
  1. df(df: pandas.DataFrame, connection: duckdb.DuckDBPyConnection = None) -> duckdb.DuckDBPyRelation

  2. +
  3. df(df: pandas.DataFrame, connection: duckdb.DuckDBPyConnection = None) -> duckdb.duckdb.DuckDBPyRelation

Create a relation object from the DataFrame df

@@ -1896,7 +2641,7 @@ title: Python Client API
-duckdb.distinct(df: pandas.DataFrame, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +duckdb.distinct(df: pandas.DataFrame, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation

Compute the distinct rows from DataFrame df

@@ -1905,7 +2650,7 @@ title: Python Client API
-duckdb.dtype(type_str: str, connection: duckdb.DuckDBPyConnection = None) duckdb.typing.DuckDBPyType +duckdb.dtype(type_str: str, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType

Create a type object from ‘type_str’

@@ -1914,7 +2659,7 @@ title: Python Client API
-duckdb.duplicate(connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +duckdb.duplicate(connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection

Create a duplicate of the current connection

@@ -1923,7 +2668,7 @@ title: Python Client API
-duckdb.enum_type(name: str, type: duckdb.typing.DuckDBPyType, values: list, connection: duckdb.DuckDBPyConnection = None) duckdb.typing.DuckDBPyType +duckdb.enum_type(name: str, type: duckdb.duckdb.typing.DuckDBPyType, values: list, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType

Create an enum type of underlying ‘type’, consisting of the list of ‘values’

@@ -1932,7 +2677,7 @@ title: Python Client API
-duckdb.execute(query: str, parameters: object = None, multiple_parameter_sets: bool = False, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +duckdb.execute(query: str, parameters: object = None, multiple_parameter_sets: bool = False, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection

Execute the given SQL query, optionally using prepared statements with parameters set

@@ -1941,7 +2686,7 @@ title: Python Client API
-duckdb.executemany(query: str, parameters: object = None, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +duckdb.executemany(query: str, parameters: object = None, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection

Execute the given prepared statement multiple times using the list of parameter sets in parameters

@@ -1950,7 +2695,7 @@ title: Python Client API
-duckdb.fetch_arrow_table(rows_per_batch: int = 1000000, connection: duckdb.DuckDBPyConnection = None) pyarrow.lib.Table +duckdb.fetch_arrow_table(rows_per_batch: int = 1000000, connection: duckdb.DuckDBPyConnection = None) pyarrow.lib.Table

Fetch a result as Arrow table following execute()

@@ -1959,7 +2704,7 @@ title: Python Client API
-duckdb.fetch_df(*, date_as_object: bool = False, connection: duckdb.DuckDBPyConnection = None) pandas.DataFrame +duckdb.fetch_df(*, date_as_object: bool = False, connection: duckdb.DuckDBPyConnection = None) pandas.DataFrame

Fetch a result as DataFrame following execute()

@@ -1968,7 +2713,7 @@ title: Python Client API
-duckdb.fetch_df_chunk(vectors_per_chunk: int = 1, *, date_as_object: bool = False, connection: duckdb.DuckDBPyConnection = None) pandas.DataFrame +duckdb.fetch_df_chunk(vectors_per_chunk: int = 1, *, date_as_object: bool = False, connection: duckdb.DuckDBPyConnection = None) pandas.DataFrame

Fetch a chunk of the result as DataFrame following execute()

@@ -1977,7 +2722,7 @@ title: Python Client API
-duckdb.fetch_record_batch(rows_per_batch: int = 1000000, connection: duckdb.DuckDBPyConnection = None) pyarrow.lib.RecordBatchReader +duckdb.fetch_record_batch(rows_per_batch: int = 1000000, connection: duckdb.DuckDBPyConnection = None) pyarrow.lib.RecordBatchReader

Fetch an Arrow RecordBatchReader following execute()

@@ -1986,7 +2731,7 @@ title: Python Client API
-duckdb.fetchall(connection: duckdb.DuckDBPyConnection = None) list +duckdb.fetchall(connection: duckdb.DuckDBPyConnection = None) list

Fetch all rows from a result following execute

@@ -1995,7 +2740,7 @@ title: Python Client API
-duckdb.fetchdf(*, date_as_object: bool = False, connection: duckdb.DuckDBPyConnection = None) pandas.DataFrame +duckdb.fetchdf(*, date_as_object: bool = False, connection: duckdb.DuckDBPyConnection = None) pandas.DataFrame

Fetch a result as DataFrame following execute()

@@ -2004,7 +2749,7 @@ title: Python Client API
-duckdb.fetchmany(size: int = 1, connection: duckdb.DuckDBPyConnection = None) list +duckdb.fetchmany(size: int = 1, connection: duckdb.DuckDBPyConnection = None) list

Fetch the next set of rows from a result following execute

@@ -2013,7 +2758,7 @@ title: Python Client API
-duckdb.fetchnumpy(connection: duckdb.DuckDBPyConnection = None) dict +duckdb.fetchnumpy(connection: duckdb.DuckDBPyConnection = None) dict

Fetch a result as list of NumPy arrays following execute

@@ -2022,7 +2767,7 @@ title: Python Client API
-duckdb.fetchone(connection: duckdb.DuckDBPyConnection = None) Optional[tuple] +duckdb.fetchone(connection: duckdb.DuckDBPyConnection = None) Optional[tuple]

Fetch a single row from a result following execute

@@ -2031,7 +2776,7 @@ title: Python Client API
-duckdb.filesystem_is_registered(name: str, connection: duckdb.DuckDBPyConnection = None) bool +duckdb.filesystem_is_registered(name: str, connection: duckdb.DuckDBPyConnection = None) bool

Check if a filesystem with the provided name is currently registered

@@ -2040,7 +2785,7 @@ title: Python Client API
-duckdb.filter(df: pandas.DataFrame, filter_expr: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +duckdb.filter(df: pandas.DataFrame, filter_expr: str, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation

Filter the DataFrame df by the filter in filter_expr

@@ -2049,7 +2794,7 @@ title: Python Client API
-duckdb.from_arrow(arrow_object: object, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +duckdb.from_arrow(arrow_object: object, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation

Create a relation object from an Arrow object

@@ -2058,7 +2803,7 @@ title: Python Client API
-duckdb.from_csv_auto(name: object, connection: duckdb.DuckDBPyConnection = None, header: object = None, compression: object = None, sep: object = None, delimiter: object = None, dtype: object = None, na_values: object = None, skiprows: object = None, quotechar: object = None, escapechar: object = None, encoding: object = None, parallel: object = None, date_format: object = None, timestamp_format: object = None, sample_size: object = None, all_varchar: object = None, normalize_names: object = None, filename: object = None, null_padding: object = None) duckdb.DuckDBPyRelation +duckdb.from_csv_auto(name: object, connection: duckdb.DuckDBPyConnection = None, header: object = None, compression: object = None, sep: object = None, delimiter: object = None, dtype: object = None, na_values: object = None, skiprows: object = None, quotechar: object = None, escapechar: object = None, encoding: object = None, parallel: object = None, date_format: object = None, timestamp_format: object = None, sample_size: object = None, all_varchar: object = None, normalize_names: object = None, filename: object = None, null_padding: object = None, names: object = None) duckdb.duckdb.DuckDBPyRelation

Create a relation object from the CSV file in ‘name’

@@ -2067,7 +2812,7 @@ title: Python Client API
-duckdb.from_df(df: pandas.DataFrame, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +duckdb.from_df(df: pandas.DataFrame, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation

Create a relation object from the DataFrame df

@@ -2076,16 +2821,16 @@ title: Python Client API
-duckdb.from_parquet(*args, **kwargs) +duckdb.from_parquet(*args, **kwargs)

Overloaded function.

    -
  1. from_parquet(file_glob: str, binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None, connection: duckdb.DuckDBPyConnection = None) -> duckdb.DuckDBPyRelation

  2. +
  3. from_parquet(file_glob: str, binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None, connection: duckdb.DuckDBPyConnection = None) -> duckdb.duckdb.DuckDBPyRelation

Create a relation object from the Parquet files in file_glob

    -
  1. from_parquet(file_globs: List[str], binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None, connection: duckdb.DuckDBPyConnection = None) -> duckdb.DuckDBPyRelation

  2. +
  3. from_parquet(file_globs: List[str], binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None, connection: duckdb.DuckDBPyConnection = None) -> duckdb.duckdb.DuckDBPyRelation

Create a relation object from the Parquet files in file_globs

@@ -2093,33 +2838,25 @@ title: Python Client API
-duckdb.from_query(*args, **kwargs) +duckdb.from_query(query: str, alias: str = '', connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation
-

Overloaded function.

-
    -
  1. from_query(query: str, alias: str = ‘query_relation’, connection: duckdb.DuckDBPyConnection = None) -> duckdb.DuckDBPyRelation

  2. -
-

Create a relation object from the given SQL query

-
    -
  1. from_query(query: str, alias: str = ‘query_relation’, connection: duckdb.DuckDBPyConnection = None) -> duckdb.DuckDBPyRelation

  2. -
-

Create a relation object from the given SQL query

+

Run a SQL query. If it is a SELECT statement, create a relation object from the given SQL query, otherwise run the query as-is.

-duckdb.from_substrait(*args, **kwargs) +duckdb.from_substrait(*args, **kwargs)

Overloaded function.

    -
  1. from_substrait(proto: bytes, connection: duckdb.DuckDBPyConnection = None) -> duckdb.DuckDBPyRelation

  2. +
  3. from_substrait(proto: bytes, connection: duckdb.DuckDBPyConnection = None) -> duckdb.duckdb.DuckDBPyRelation

Creates a query object from the substrait plan

    -
  1. from_substrait(proto: bytes, connection: duckdb.DuckDBPyConnection = None) -> duckdb.DuckDBPyRelation

  2. +
  3. from_substrait(proto: bytes, connection: duckdb.DuckDBPyConnection = None) -> duckdb.duckdb.DuckDBPyRelation

Create a query object from protobuf plan

@@ -2127,7 +2864,7 @@ title: Python Client API
-duckdb.from_substrait_json(json: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +duckdb.from_substrait_json(json: str, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation

Serialize a query object to protobuf

@@ -2136,16 +2873,16 @@ title: Python Client API
-duckdb.get_substrait(*args, **kwargs) +duckdb.get_substrait(*args, **kwargs)

Overloaded function.

    -
  1. get_substrait(query: str, connection: duckdb.DuckDBPyConnection = None, *, enable_optimizer: bool = True) -> duckdb.DuckDBPyRelation

  2. +
  3. get_substrait(query: str, connection: duckdb.DuckDBPyConnection = None, *, enable_optimizer: bool = True) -> duckdb.duckdb.DuckDBPyRelation

Serialize a query object to protobuf

    -
  1. get_substrait(query: str, connection: duckdb.DuckDBPyConnection = None, *, enable_optimizer: bool = True) -> duckdb.DuckDBPyRelation

  2. +
  3. get_substrait(query: str, connection: duckdb.DuckDBPyConnection = None, *, enable_optimizer: bool = True) -> duckdb.duckdb.DuckDBPyRelation

Serialize a query to protobuf

@@ -2153,16 +2890,16 @@ title: Python Client API
-duckdb.get_substrait_json(*args, **kwargs) +duckdb.get_substrait_json(*args, **kwargs)

Overloaded function.

    -
  1. get_substrait_json(query: str, connection: duckdb.DuckDBPyConnection = None, *, enable_optimizer: bool = True) -> duckdb.DuckDBPyRelation

  2. +
  3. get_substrait_json(query: str, connection: duckdb.DuckDBPyConnection = None, *, enable_optimizer: bool = True) -> duckdb.duckdb.DuckDBPyRelation

Serialize a query object to protobuf

    -
  1. get_substrait_json(query: str, connection: duckdb.DuckDBPyConnection = None, *, enable_optimizer: bool = True) -> duckdb.DuckDBPyRelation

  2. +
  3. get_substrait_json(query: str, connection: duckdb.DuckDBPyConnection = None, *, enable_optimizer: bool = True) -> duckdb.duckdb.DuckDBPyRelation

Serialize a query to protobuf on the JSON format

@@ -2170,7 +2907,7 @@ title: Python Client API
-duckdb.get_table_names(query: str, connection: duckdb.DuckDBPyConnection = None) Set[str] +duckdb.get_table_names(query: str, connection: duckdb.DuckDBPyConnection = None) Set[str]

Extract the required table names from a query

@@ -2179,16 +2916,25 @@ title: Python Client API
-duckdb.install_extension(extension: str, *, force_install: bool = False, connection: duckdb.DuckDBPyConnection = None) None +duckdb.install_extension(extension: str, *, force_install: bool = False, connection: duckdb.DuckDBPyConnection = None) None

Install an extension by name

+
+
+duckdb.interrupt(connection: duckdb.DuckDBPyConnection = None) None +
+
+

Interrupt pending operations

+
+
+
-duckdb.limit(df: pandas.DataFrame, n: int, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +duckdb.limit(df: pandas.DataFrame, n: int, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation

Retrieve the first n rows from the DataFrame df

@@ -2197,7 +2943,7 @@ title: Python Client API
-duckdb.list_filesystems(connection: duckdb.DuckDBPyConnection = None) list +duckdb.list_filesystems(connection: duckdb.DuckDBPyConnection = None) list

List registered filesystems, including builtin ones

@@ -2206,7 +2952,7 @@ title: Python Client API
-duckdb.list_type(type: duckdb.typing.DuckDBPyType, connection: duckdb.DuckDBPyConnection = None) duckdb.typing.DuckDBPyType +duckdb.list_type(type: duckdb.duckdb.typing.DuckDBPyType, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType

Create an array type object of ‘type’

@@ -2215,7 +2961,7 @@ title: Python Client API
-duckdb.load_extension(extension: str, connection: duckdb.DuckDBPyConnection = None) None +duckdb.load_extension(extension: str, connection: duckdb.DuckDBPyConnection = None) None

Load an installed extension

@@ -2224,7 +2970,7 @@ title: Python Client API
-duckdb.map_type(key: duckdb.typing.DuckDBPyType, value: duckdb.typing.DuckDBPyType, connection: duckdb.DuckDBPyConnection = None) duckdb.typing.DuckDBPyType +duckdb.map_type(key: duckdb.duckdb.typing.DuckDBPyType, value: duckdb.duckdb.typing.DuckDBPyType, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType

Create a map type object from ‘key_type’ and ‘value_type’

@@ -2233,7 +2979,7 @@ title: Python Client API
-duckdb.order(df: pandas.DataFrame, order_expr: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +duckdb.order(df: pandas.DataFrame, order_expr: str, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation

Reorder the DataFrame df by order_expr

@@ -2242,7 +2988,7 @@ title: Python Client API
-duckdb.pl(rows_per_batch: int = 1000000, connection: duckdb.DuckDBPyConnection = None) duckdb::PolarsDataFrame +duckdb.pl(rows_per_batch: int = 1000000, connection: duckdb.DuckDBPyConnection = None) duckdb::PolarsDataFrame

Fetch a result as Polars DataFrame following execute()

@@ -2251,7 +2997,7 @@ title: Python Client API
-duckdb.project(df: pandas.DataFrame, project_expr: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +duckdb.project(df: pandas.DataFrame, project_expr: object, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation

Project the DataFrame df by the projection in project_expr

@@ -2260,24 +3006,16 @@ title: Python Client API
-duckdb.query(*args, **kwargs) +duckdb.query(query: str, alias: str = '', connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation
-

Overloaded function.

-
    -
  1. query(query: str, alias: str = ‘query_relation’, connection: duckdb.DuckDBPyConnection = None) -> duckdb.DuckDBPyRelation

  2. -
-

Run a SQL query. If it is a SELECT statement, create a relation object from the given SQL query, otherwise run the query as-is.

-
    -
  1. query(query: str, alias: str = ‘query_relation’, connection: duckdb.DuckDBPyConnection = None) -> duckdb.DuckDBPyRelation

  2. -

Run a SQL query. If it is a SELECT statement, create a relation object from the given SQL query, otherwise run the query as-is.

-duckdb.query_df(df: pandas.DataFrame, virtual_table_name: str, sql_query: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +duckdb.query_df(df: pandas.DataFrame, virtual_table_name: str, sql_query: str, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation

Run the given SQL query in sql_query on the view named virtual_table_name that contains the content of DataFrame df

@@ -2286,7 +3024,7 @@ title: Python Client API
-duckdb.read_csv(name: object, connection: duckdb.DuckDBPyConnection = None, header: object = None, compression: object = None, sep: object = None, delimiter: object = None, dtype: object = None, na_values: object = None, skiprows: object = None, quotechar: object = None, escapechar: object = None, encoding: object = None, parallel: object = None, date_format: object = None, timestamp_format: object = None, sample_size: object = None, all_varchar: object = None, normalize_names: object = None, filename: object = None, null_padding: object = None) duckdb.DuckDBPyRelation +duckdb.read_csv(name: object, connection: duckdb.DuckDBPyConnection = None, header: object = None, compression: object = None, sep: object = None, delimiter: object = None, dtype: object = None, na_values: object = None, skiprows: object = None, quotechar: object = None, escapechar: object = None, encoding: object = None, parallel: object = None, date_format: object = None, timestamp_format: object = None, sample_size: object = None, all_varchar: object = None, normalize_names: object = None, filename: object = None, null_padding: object = None, names: object = None) duckdb.duckdb.DuckDBPyRelation

Create a relation object from the CSV file in ‘name’

@@ -2295,7 +3033,7 @@ title: Python Client API
-duckdb.read_json(name: str, connection: duckdb.DuckDBPyConnection = None, columns: Optional[object] = None, sample_size: Optional[object] = None, maximum_depth: Optional[object] = None, records: Optional[str] = None, format: Optional[str] = None) duckdb.DuckDBPyRelation +duckdb.read_json(name: str, connection: duckdb.DuckDBPyConnection = None, columns: Optional[object] = None, sample_size: Optional[object] = None, maximum_depth: Optional[object] = None, records: Optional[str] = None, format: Optional[str] = None) duckdb.duckdb.DuckDBPyRelation

Create a relation object from the JSON file in ‘name’

@@ -2304,16 +3042,16 @@ title: Python Client API
-duckdb.read_parquet(*args, **kwargs) +duckdb.read_parquet(*args, **kwargs)

Overloaded function.

    -
  1. read_parquet(file_glob: str, binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None, connection: duckdb.DuckDBPyConnection = None) -> duckdb.DuckDBPyRelation

  2. +
  3. read_parquet(file_glob: str, binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None, connection: duckdb.DuckDBPyConnection = None) -> duckdb.duckdb.DuckDBPyRelation

Create a relation object from the Parquet files in file_glob

    -
  1. read_parquet(file_globs: List[str], binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None, connection: duckdb.DuckDBPyConnection = None) -> duckdb.DuckDBPyRelation

  2. +
  3. read_parquet(file_globs: List[str], binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None, connection: duckdb.DuckDBPyConnection = None) -> duckdb.duckdb.DuckDBPyRelation

Create a relation object from the Parquet files in file_globs

@@ -2321,7 +3059,7 @@ title: Python Client API
-duckdb.register(view_name: str, python_object: object, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +duckdb.register(view_name: str, python_object: object, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection

Register the passed Python Object value for querying with a view

@@ -2330,7 +3068,7 @@ title: Python Client API
-duckdb.register_filesystem(filesystem: fsspec.AbstractFileSystem, connection: duckdb.DuckDBPyConnection = None) None +duckdb.register_filesystem(filesystem: fsspec.AbstractFileSystem, connection: duckdb.DuckDBPyConnection = None) None

Register a fsspec compliant filesystem

@@ -2339,7 +3077,7 @@ title: Python Client API
-duckdb.remove_function(name: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +duckdb.remove_function(name: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection

Remove a previously created function

@@ -2348,7 +3086,7 @@ title: Python Client API
-duckdb.rollback(connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +duckdb.rollback(connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection

Roll back changes performed within a transaction

@@ -2357,16 +3095,25 @@ title: Python Client API
-duckdb.row_type(fields: object, connection: duckdb.DuckDBPyConnection = None) duckdb.typing.DuckDBPyType +duckdb.row_type(fields: object, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType

Create a struct type object from ‘fields’

+
+
+duckdb.rowcount(connection: duckdb.DuckDBPyConnection = None) int +
+
+

Get result set row count

+
+
+
-duckdb.sql(query: str, alias: str = 'query_relation', connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +duckdb.sql(query: str, alias: str = '', connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation

Run a SQL query. If it is a SELECT statement, create a relation object from the given SQL query, otherwise run the query as-is.

@@ -2375,7 +3122,7 @@ title: Python Client API
-duckdb.sqltype(type_str: str, connection: duckdb.DuckDBPyConnection = None) duckdb.typing.DuckDBPyType +duckdb.sqltype(type_str: str, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType

Create a type object from ‘type_str’

@@ -2384,7 +3131,7 @@ title: Python Client API
-duckdb.string_type(collation: str = '', connection: duckdb.DuckDBPyConnection = None) duckdb.typing.DuckDBPyType +duckdb.string_type(collation: str = '', connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType

Create a string type with an optional collation

@@ -2393,7 +3140,7 @@ title: Python Client API
-duckdb.struct_type(fields: object, connection: duckdb.DuckDBPyConnection = None) duckdb.typing.DuckDBPyType +duckdb.struct_type(fields: object, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType

Create a struct type object from ‘fields’

@@ -2402,7 +3149,7 @@ title: Python Client API
-duckdb.table(table_name: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +duckdb.table(table_name: str, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation

Create a relation object for the name’d table

@@ -2411,7 +3158,7 @@ title: Python Client API
-duckdb.table_function(name: str, parameters: object = None, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +duckdb.table_function(name: str, parameters: object = None, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation

Create a relation object from the name’d table function with given parameters

@@ -2420,7 +3167,7 @@ title: Python Client API
-duckdb.tf(connection: duckdb.DuckDBPyConnection = None) dict +duckdb.tf(connection: duckdb.DuckDBPyConnection = None) dict

Fetch a result as dict of TensorFlow Tensors following execute()

@@ -2429,7 +3176,7 @@ title: Python Client API
-class duckdb.token_type +class duckdb.token_type

Bases: pybind11_object

@@ -2442,56 +3189,56 @@ title: Python Client API

comment

-comment = <token_type.comment: 5> +comment = <token_type.comment: 5>
-identifier = <token_type.identifier: 0> +identifier = <token_type.identifier: 0>
-keyword = <token_type.keyword: 4> +keyword = <token_type.keyword: 4>
-property name +property name
-numeric_const = <token_type.numeric_const: 1> +numeric_const = <token_type.numeric_const: 1>
-operator = <token_type.operator: 3> +operator = <token_type.operator: 3>
-string_const = <token_type.string_const: 2> +string_const = <token_type.string_const: 2>
-property value +property value
@@ -2501,7 +3248,7 @@ title: Python Client API
-duckdb.tokenize(query: str) list +duckdb.tokenize(query: str) list

Tokenizes a SQL string, returning a list of (position, type) tuples that can be used for e.g. syntax highlighting

@@ -2510,7 +3257,7 @@ title: Python Client API
-duckdb.torch(connection: duckdb.DuckDBPyConnection = None) dict +duckdb.torch(connection: duckdb.DuckDBPyConnection = None) dict

Fetch a result as dict of PyTorch Tensors following execute()

@@ -2519,7 +3266,7 @@ title: Python Client API
-duckdb.type(type_str: str, connection: duckdb.DuckDBPyConnection = None) duckdb.typing.DuckDBPyType +duckdb.type(type_str: str, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType

Create a type object from ‘type_str’

@@ -2528,7 +3275,7 @@ title: Python Client API
-duckdb.union_type(members: object, connection: duckdb.DuckDBPyConnection = None) duckdb.typing.DuckDBPyType +duckdb.union_type(members: object, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType

Create a union type object from ‘members’

@@ -2537,7 +3284,7 @@ title: Python Client API
-duckdb.unregister(view_name: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +duckdb.unregister(view_name: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection

Unregister the view name

@@ -2546,7 +3293,7 @@ title: Python Client API
-duckdb.unregister_filesystem(name: str, connection: duckdb.DuckDBPyConnection = None) None +duckdb.unregister_filesystem(name: str, connection: duckdb.DuckDBPyConnection = None) None

Unregister a filesystem

@@ -2555,16 +3302,16 @@ title: Python Client API
-duckdb.values(*args, **kwargs) +duckdb.values(*args, **kwargs)

Overloaded function.

    -
  1. values(values: object, connection: duckdb.DuckDBPyConnection = None) -> duckdb.DuckDBPyRelation

  2. +
  3. values(values: object, connection: duckdb.DuckDBPyConnection = None) -> duckdb.duckdb.DuckDBPyRelation

Create a relation object from the passed values

    -
  1. values(values: object, connection: duckdb.DuckDBPyConnection = None) -> duckdb.DuckDBPyRelation

  2. +
  3. values(values: object, connection: duckdb.DuckDBPyConnection = None) -> duckdb.duckdb.DuckDBPyRelation

Create a relation object from the passed values

@@ -2572,7 +3319,7 @@ title: Python Client API
-duckdb.view(view_name: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +duckdb.view(view_name: str, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation

Create a relation object for the name’d view

@@ -2581,7 +3328,7 @@ title: Python Client API
-duckdb.write_csv(df: pandas.DataFrame, file_name: str, connection: duckdb.DuckDBPyConnection = None) None +duckdb.write_csv(df: pandas.DataFrame, file_name: str, connection: duckdb.DuckDBPyConnection = None) None

Write the DataFrame df to a CSV file in file_name

diff --git a/docs/sql/configuration.md b/docs/sql/configuration.md index d493f1c7553..42b6a8c654c 100644 --- a/docs/sql/configuration.md +++ b/docs/sql/configuration.md @@ -38,6 +38,7 @@ Below is a list of all available settings. | Calendar | The current calendar | VARCHAR | System (locale) calendar | | TimeZone | The current time zone | VARCHAR | System (locale) timezone | | access_mode | Access mode of the database (**AUTOMATIC**, **READ_ONLY** or **READ_WRITE**) | VARCHAR | AUTOMATIC | +| allocator_flush_threshold | Peak allocation threshold at which to flush the allocator after completing a task. | VARCHAR | 134.2MB | | allow_unsigned_extensions | Allow to load extensions with invalid or missing signatures | BOOLEAN | FALSE | | arrow_large_buffer_size | If arrow buffers for strings, blobs, uuids and bits should be exported using large buffers | BOOLEAN | FALSE | | binary_as_string | In Parquet files, interpret binary data as a string. | BOOLEAN | | @@ -46,6 +47,7 @@ Below is a list of all available settings. | default_collation | The collation setting used when none is specified | VARCHAR | | | default_null_order, null_order | Null ordering used when none is specified (**NULLS_FIRST** or **NULLS_LAST**) | VARCHAR | NULLS_LAST | | default_order | The order type used when none is specified (**ASC** or **DESC**) | VARCHAR | ASC | +| disabled_filesystems | Disable specific file systems preventing access (e.g. LocalFileSystem) | VARCHAR | | | enable_external_access | Allow the database to access external state (through e.g. loading/installing modules, COPY TO/FROM, CSV readers, pandas replacement scans, etc) | BOOLEAN | TRUE | | enable_fsst_vectors | Allow scans on FSST compressed segments to emit compressed vectors to utilize late decompression | BOOLEAN | FALSE | | enable_http_metadata_cache | Whether or not the global http metadata is used to cache HTTP metadata | BOOLEAN | FALSE | @@ -73,7 +75,9 @@ Below is a list of all available settings. | ordered_aggregate_threshold | the number of rows to accumulate before sorting, used for tuning | UBIGINT | 262144 | | password | The password to use. Ignored for legacy compatibility. | VARCHAR | NULL | | perfect_ht_threshold | Threshold in bytes for when to use a perfect hash table (default: 12) | BIGINT | 12 | -| pivot_limit | The maximum numer of pivot columns in a pivot statement (default: 100000) | BIGINT | 100000 | +| pivot_filter_threshold | The threshold to switch from using filtered aggregates to LIST with a dedicated pivot operator | BIGINT | 10 | +| pivot_limit | The maximum number of pivot columns in a pivot statement (default: 100000) | BIGINT | 100000 | +| prefer_range_joins | Force use of range joins with mixed predicates | BOOLEAN | FALSE | | preserve_identifier_case | Whether or not to preserve the identifier case, instead of always lowercasing all non-quoted identifiers | BOOLEAN | TRUE | | preserve_insertion_order | Whether or not to preserve insertion order. If set to false the system is allowed to re-order any results that do not contain ORDER BY clauses. | BOOLEAN | TRUE | | profile_output, profiling_output | The file to which profile output should be saved, or empty to print to the terminal | VARCHAR | |