Skip to content

Commit 0b3cc24

Browse files
committed
Small updates after rebase
1 parent 062e6c2 commit 0b3cc24

File tree

2 files changed

+5
-21
lines changed

2 files changed

+5
-21
lines changed

python/datafusion/catalog.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,6 @@ def __repr__(self) -> str:
5050
"""Print a string representation of the catalog."""
5151
return self.catalog.__repr__()
5252

53-
def names(self) -> list[str]:
54-
"""Returns the list of databases in this catalog."""
55-
return self.catalog.names()
56-
57-
def database(self, name: str = "public") -> Database:
58-
"""Returns the database with the given ``name`` from this catalog."""
59-
return Database(self.catalog.database(name))
60-
61-
62-
class Database:
63-
"""DataFusion Database."""
64-
65-
def __init__(self, db: df_internal.Database) -> None:
66-
"""This constructor is not typically called by the end user."""
67-
self.db = db
68-
69-
def __repr__(self) -> str:
70-
"""Print a string representation of the database."""
71-
return self.db.__repr__()
72-
7353
def names(self) -> set[str]:
7454
"""This is an alias for `schema_names`."""
7555
return self.schema_names()
@@ -109,6 +89,10 @@ def __init__(self, schema: df_internal.catalog.RawSchema) -> None:
10989
"""This constructor is not typically called by the end user."""
11090
self._raw_schema = schema
11191

92+
def __repr__(self) -> str:
93+
"""Print a string representation of the schema."""
94+
return self._raw_schema.__repr__()
95+
11296
def names(self) -> set[str]:
11397
"""This is an alias for `table_names`."""
11498
return self.table_names()

src/catalog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl PySchema {
160160
}
161161

162162
fn table(&self, name: &str, py: Python) -> PyDataFusionResult<PyTable> {
163-
if let Some(table) = wait_for_future(py, self.database.table(name))?? {
163+
if let Some(table) = wait_for_future(py, self.schema.table(name))?? {
164164
Ok(PyTable::new(table))
165165
} else {
166166
Err(PyDataFusionError::Common(format!(

0 commit comments

Comments
 (0)