Skip to content

Commit

Permalink
test(oracle): add snapshots and followup notes
Browse files Browse the repository at this point in the history
  • Loading branch information
gforsyth committed Jan 19, 2024
1 parent d414fee commit 0882028
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ibis/backends/oracle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ def _metadata(self, query: str) -> Iterable[tuple[str, dt.DataType]]:
if isinstance(sg_expr, sg.exp.Table):
sg_expr = sg.select(STAR).from_(sg_expr)

# TODO(gforsyth): followup -- this should probably be made a default
# transform for quoting backends
def transformer(node):

Check warning on line 392 in ibis/backends/oracle/__init__.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/oracle/__init__.py#L392

Added line #L392 was not covered by tests
if isinstance(node, sg.exp.Table):
return sg.table(node.name, quoted=True)

Check warning on line 394 in ibis/backends/oracle/__init__.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/oracle/__init__.py#L394

Added line #L394 was not covered by tests
Expand Down Expand Up @@ -461,6 +463,8 @@ def transformer(node):
yield name, typ

def _fetch_from_cursor(self, cursor, schema: sch.Schema) -> pd.DataFrame:

Check warning on line 465 in ibis/backends/oracle/__init__.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/oracle/__init__.py#L465

Added line #L465 was not covered by tests
# TODO(gforsyth): this can probably be generalized a bit and put into
# the base backend (or a mixin)
import pandas as pd

Check warning on line 468 in ibis/backends/oracle/__init__.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/oracle/__init__.py#L468

Added line #L468 was not covered by tests

from ibis.backends.oracle.converter import OraclePandasData

Check warning on line 470 in ibis/backends/oracle/__init__.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/oracle/__init__.py#L470

Added line #L470 was not covered by tests
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SELECT
"t0"."id",
"t0"."bool_col" = 1 AS "bool_col"
FROM "functional_alltypes" "t0"
FETCH FIRST 11 ROWS ONLY
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SELECT
"t0"."id",
"t0"."bool_col" = 1 AS "bool_col"
FROM "functional_alltypes" "t0"
FETCH FIRST 11 ROWS ONLY
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
SELECT
SUM("t1"."bigint_col") AS "Sum(bigint_col)"
FROM (
SELECT
"t0"."id",
"t0"."bool_col" = 1 AS "bool_col",
"t0"."tinyint_col",
"t0"."smallint_col",
"t0"."int_col",
"t0"."bigint_col",
"t0"."float_col",
"t0"."double_col",
"t0"."date_string_col",
"t0"."string_col",
"t0"."timestamp_col",
"t0"."year",
"t0"."month"
FROM "functional_alltypes" "t0"
) "t1"
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SELECT
*
FROM (
SELECT
"t0"."id",
"t0"."bool_col" = 1 AS "bool_col"
FROM "functional_alltypes" "t0"
FETCH FIRST 10 ROWS ONLY
) "t2"
FETCH FIRST 11 ROWS ONLY

0 comments on commit 0882028

Please sign in to comment.