Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(catalog): Cutover deprecated APIs to use session, catalog, table abstractions [3/3] #3830

Merged
merged 22 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
bc0a6d6
feat(catalog): [1/3] prepare existing catalog APIs for integration
rchowell Feb 17, 2025
deeb4bc
Fix PyIdentifier import
rchowell Feb 18, 2025
76cdba8
Fix polymorphic Catalog factory methods
rchowell Feb 18, 2025
d78a3ab
Imports minimal python catalog and table APIs
rchowell Feb 18, 2025
7307a06
Adds python-rust types for minimal session actions
rchowell Feb 18, 2025
f8895c1
Fix make build and lints
rchowell Feb 19, 2025
b943513
Implements py Table(ABC) backed by rs TableRef
rchowell Feb 19, 2025
9ca45c2
Adds create_temp_table to allow using dataframes in sessions
rchowell Feb 20, 2025
53f23a9
Removes unused daft-session dep
rchowell Feb 21, 2025
c5a2db7
Removes unused inner property
rchowell Feb 21, 2025
15e6af9
Remove unused dep
rchowell Feb 21, 2025
470d238
Adds back register_python_catalog and rebase on main
rchowell Feb 21, 2025
bd6049f
Defines session APIs for daft top-level namespace
rchowell Feb 19, 2025
c9a4af9
Migrate daft.catalog top-level functions
rchowell Feb 19, 2025
b3db258
Ports tests and removes deprecated APIs
rchowell Feb 19, 2025
c92575d
Fixes daft-connect table replacement
rchowell Feb 19, 2025
e439e7f
Merge from main
rchowell Feb 25, 2025
1a60f1d
fix merge issues
rchowell Feb 25, 2025
2516d5f
adds qualified table name resolution
rchowell Feb 25, 2025
41e5388
use 'default' as default catalog
rchowell Feb 25, 2025
785a6ce
fixes to qualified name resolution
rchowell Feb 25, 2025
8b8be7f
make get_table errors resolve to none like legacy behavior
rchowell Feb 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ common-tracing = {path = "src/common/tracing", default-features = false}
common-version = {path = "src/common/version", default-features = false}
daft-algebra = {path = "src/daft-algebra", default-features = false}
daft-catalog = {path = "src/daft-catalog", default-features = false}
daft-catalog-python-catalog = {path = "src/daft-catalog/python-catalog", optional = true}
daft-compression = {path = "src/daft-compression", default-features = false}
daft-connect = {path = "src/daft-connect", optional = true}
daft-context = {path = "src/daft-context", default-features = false}
Expand Down Expand Up @@ -50,15 +49,17 @@ sysinfo = {workspace = true}
[features]
# maturin will turn this on
python = [
"dep:pyo3",
"dep:pyo3-log",
"common-daft-config/python",
"common-display/python",
"common-partitioning/python",
"common-resource-request/python",
"common-file-formats/python",
"common-scan-info/python",
"common-system-info/python",
"daft-catalog-python-catalog/python",
"daft-catalog/python",
"daft-connect/python",
"daft-context/python",
"daft-core/python",
"daft-csv/python",
Expand All @@ -80,11 +81,7 @@ python = [
"daft-session/python",
"daft-stats/python",
"daft-recordbatch/python",
"daft-writers/python",
"dep:daft-connect",
"daft-connect/python",
"dep:pyo3",
"dep:pyo3-log"
"daft-writers/python"
]

[lib]
Expand Down
42 changes: 40 additions & 2 deletions daft/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@
###

from daft.catalog import (
Catalog,
Identifier,
read_table,
Table,
register_table,
)
from daft.context import set_execution_config, set_planning_config, execution_config_ctx, planning_config_ctx
Expand Down Expand Up @@ -90,14 +91,35 @@
read_lance,
)
from daft.series import Series
from daft.session import Session, current_session, set_session
from daft.session import (

Check warning on line 94 in daft/__init__.py

View check run for this annotation

Codecov / codecov/patch

daft/__init__.py#L94

Added line #L94 was not covered by tests
Session,
attach_catalog,
attach_table,
detach_catalog,
detach_table,
create_temp_table,
current_catalog,
current_namespace,
current_session,
get_catalog,
get_table,
has_catalog,
has_table,
list_catalogs,
list_tables,
read_table,
set_catalog,
set_namespace,
set_session,
)
from daft.sql import sql, sql_expr
from daft.udf import udf
from daft.viz import register_viz_hook

to_struct = Expression.to_struct

__all__ = [
"Catalog",
"DataCatalogTable",
"DataCatalogType",
"DataFrame",
Expand All @@ -110,10 +132,18 @@
"Schema",
"Series",
"Session",
"Table",
"TimeUnit",
"attach_catalog",
"attach_table",
"coalesce",
"col",
"create_temp_table",
"current_catalog",
"current_namespace",
"current_session",
"detach_catalog",
"detach_table",
"execution_config_ctx",
"from_arrow",
"from_dask_dataframe",
Expand All @@ -122,8 +152,14 @@
"from_pydict",
"from_pylist",
"from_ray_dataset",
"get_catalog",
"get_table",
"has_catalog",
"has_table",
"interval",
"list_",
"list_catalogs",
"list_tables",
"lit",
"planning_config_ctx",
"read_csv",
Expand All @@ -138,7 +174,9 @@
"refresh_logger",
"register_table",
"register_viz_hook",
"set_catalog",
"set_execution_config",
"set_namespace",
"set_planning_config",
"set_session",
"sql",
Expand Down
8 changes: 4 additions & 4 deletions daft/catalog/__iceberg.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
# get_*
###

def get_table(self, name: str | Identifier) -> IcebergTable:
if isinstance(name, Identifier):
name = tuple(name) # type: ignore
return IcebergTable(self._inner.load_table(name))
def get_table(self, ident: Identifier | str) -> IcebergTable:
if isinstance(ident, Identifier):
ident = tuple(ident) # type: ignore

Check warning on line 43 in daft/catalog/__iceberg.py

View check run for this annotation

Codecov / codecov/patch

daft/catalog/__iceberg.py#L43

Added line #L43 was not covered by tests
return IcebergTable._from_obj(self._inner.load_table(ident))

###
# list_*
Expand Down
Loading
Loading