Repository: ibis-project/ibis

Issue:
feat: expose common public types in top-level namespace
When writing code consuming `ibis` objects as part of its api, I often want to write functions that take in ibis tables/columns/scalars/values. From a UX perspective it would be nice to export a few common types in the top-level namespace so I can refer to these types in both annotations and docs as `ibis.Table` instead of `ibis.expr.types.Table`.

For my use case `ibis.Table` and `ibis.Column` alone would be sufficient. For completeness exporting `ibis.Scalar`, `ibis.Value`, and maybe `ibis.Deferred` may also be nice.


Discussion:

Resolving patch:
diff --git a/ibis/expr/api.py b/ibis/expr/api.py
--- 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",
-    "_",
 )
 
 


Test patch: