From 3f3ed2792f0e93b208fbe24bd2716a0b86618a3a Mon Sep 17 00:00:00 2001 From: Jim Crist-Harif Date: Fri, 19 Apr 2024 05:28:47 -0500 Subject: [PATCH] feat(api): expose common types in the top-level `ibis` namespace (#9008) Adds `Table`, `Column`, `Scalar`, `Value`, and `Deferred` to the top-level `ibis` namespace. These are mostly useful for downstream users consuming the ibis api (either type-annotating their code, or using `isinstance` checks). Fixes #8717. --- ibis/expr/api.py | 54 +++++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/ibis/expr/api.py b/ibis/expr/api.py index d9ca23f984e5..2dd766ac2bc8 100644 --- a/ibis/expr/api.py +++ b/ibis/expr/api.py @@ -27,11 +27,14 @@ from ibis.expr.schema import Schema from ibis.expr.sql import parse_sql, to_sql from ibis.expr.types import ( + Column, DateValue, Expr, + Scalar, Table, TimestampValue, TimeValue, + Value, array, literal, map, @@ -51,6 +54,15 @@ from ibis.expr.schema import SchemaLike __all__ = ( + "Column", + "Deferred", + "Expr", + "NA", + "Scalar", + "Schema", + "Table", + "Value", + "_", "aggregate", "and_", "array", @@ -59,20 +71,17 @@ "coalesce", "connect", "cross_join", - "cumulative_window", "cume_dist", - "rank", - "ntile", - "dense_rank", - "percent_rank", + "cumulative_window", "date", - "desc", "decompile", "deferred", + "dense_rank", + "desc", "difference", "dtype", "e", - "Expr", + "following", "geo_area", "geo_as_binary", "geo_as_ewkb", @@ -83,13 +92,15 @@ "geo_centroid", "geo_contains", "geo_contains_properly", - "geo_covers", "geo_covered_by", + "geo_covers", "geo_crosses", "geo_d_fully_within", - "geo_disjoint", - "geo_difference", "geo_d_within", + "geo_difference", + "geo_disjoint", + "geo_distance", + "geo_end_point", "geo_envelope", "geo_equals", "geo_geometry_n", @@ -97,24 +108,22 @@ "geo_intersection", "geo_intersects", "geo_is_valid", + "geo_length", "geo_line_locate_point", "geo_line_merge", "geo_line_substring", - "geo_ordering_equals", - "geo_overlaps", - "geo_touches", - "geo_distance", - "geo_end_point", - "geo_length", "geo_max_distance", "geo_n_points", "geo_n_rings", + "geo_ordering_equals", + "geo_overlaps", "geo_perimeter", "geo_point", "geo_point_n", "geo_simplify", "geo_srid", "geo_start_point", + "geo_touches", "geo_transform", "geo_unary_union", "geo_union", @@ -137,17 +146,20 @@ "literal", "map", "memtable", - "NA", "negate", "now", + "ntile", "null", "or_", "param", "parse_sql", + "percent_rank", "pi", + "preceding", "random", "range", "range_window", + "rank", "read_csv", "read_delta", "read_json", @@ -155,15 +167,14 @@ "row_number", "rows_window", "schema", - "Schema", "selectors", "set_backend", "struct", - "to_sql", "table", - "today", "time", "timestamp", + "to_sql", + "today", "trailing_range_window", "trailing_window", "union", @@ -171,9 +182,6 @@ "watermark", "where", "window", - "preceding", - "following", - "_", )