-
Notifications
You must be signed in to change notification settings - Fork 609
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(flink): add flink datatype tests
- Loading branch information
1 parent
f983bfa
commit 620bb2c
Showing
3 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from __future__ import annotations | ||
|
||
import pytest | ||
from pytest import param | ||
|
||
import ibis.expr.datatypes as dt | ||
from ibis.backends.flink.datatypes import FlinkType | ||
|
||
|
||
@pytest.mark.parametrize( | ||
("datatype", "expected"), | ||
[ | ||
param(dt.float32, "FLOAT", id="float32"), | ||
param(dt.float64, "DOUBLE", id="float64"), | ||
param(dt.uint8, "TINYINT", id="uint8"), | ||
param(dt.uint16, "SMALLINT", id="uint16"), | ||
param(dt.uint32, "INT", id="uint32"), | ||
param(dt.int8, "TINYINT", id="int8"), | ||
param(dt.int16, "SMALLINT", id="int16"), | ||
param(dt.int32, "INT", id="int32"), | ||
param(dt.int64, "BIGINT", id="int64"), | ||
param(dt.string, "VARCHAR", id="string"), | ||
param(dt.date, "DATE", id="date"), | ||
param(dt.timestamp, "TIMESTAMP", id="datetime"), | ||
param( | ||
dt.Timestamp(timezone="UTC"), | ||
"TIMESTAMP", | ||
id="timestamp_with_utc_tz", | ||
), | ||
param( | ||
dt.Timestamp(timezone="US/Eastern"), | ||
"TIMESTAMP", | ||
id="timestamp_with_other_tz", | ||
), | ||
], | ||
) | ||
def test_simple(datatype, expected): | ||
assert FlinkType.to_string(datatype) == expected |