Skip to content

Commit

Permalink
chore(polars): consolidate collect_schema calls underneath sch.infer
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Jul 4, 2024
1 parent b82ee40 commit 3a3a7fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ibis/backends/polars/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def version(self) -> str:
def list_tables(self, like=None, database=None):
return self._filter_with_like(list(self._tables.keys()), like)

def table(self, name: str, _schema: sch.Schema | None = None) -> ir.Table:
schema = PolarsSchema.to_ibis(self._tables[name].collect_schema())
def table(self, name: str) -> ir.Table:
schema = sch.infer(self._tables[name])
return ops.DatabaseTable(name, schema, self).to_expr()

@deprecated(
Expand Down Expand Up @@ -464,7 +464,7 @@ def _get_sql_string_view_schema(self, name, table, query) -> sch.Schema:

def _get_schema_using_query(self, query: str) -> sch.Schema:
lazy_frame = self._context.execute(query, eager=False)
return PolarsSchema.to_ibis(lazy_frame.collect_schema())
return sch.infer(lazy_frame)

def _to_dataframe(
self,
Expand Down

0 comments on commit 3a3a7fe

Please sign in to comment.