|
4 | 4 | import pytest |
5 | 5 | import sqlalchemy as sa |
6 | 6 | from sqlalchemy.dialects.mssql.pyodbc import MSDialect_pyodbc |
7 | | -from sqlalchemy.dialects.oracle.oracledb import OracleDialect_oracledb |
8 | 7 | from sqlalchemy.dialects.postgresql.psycopg2 import PGDialect_psycopg2 |
9 | 8 |
|
10 | 9 | import dataframely as dy |
@@ -103,51 +102,6 @@ def test_postgres_datatype(column: Column, datatype: str) -> None: |
103 | 102 | assert columns[0].type.compile(dialect) == datatype |
104 | 103 |
|
105 | 104 |
|
106 | | -@pytest.mark.parametrize( |
107 | | - ("column", "datatype"), |
108 | | - [ |
109 | | - (dy.Bool(), "SMALLINT"), |
110 | | - (dy.Date(), "DATE"), |
111 | | - (dy.Datetime(), "TIMESTAMP"), |
112 | | - (dy.Datetime(time_zone="Etc/UTC"), "TIMESTAMP WITH TIME ZONE"), |
113 | | - (dy.Time(), "TIME"), |
114 | | - (dy.Duration(), "INTERVAL DAY TO SECOND"), |
115 | | - (dy.Decimal(), "NUMERIC"), |
116 | | - (dy.Decimal(12), "NUMERIC(12, 0)"), |
117 | | - (dy.Decimal(None, 8), "NUMERIC(38, 8)"), |
118 | | - (dy.Decimal(6, 2), "NUMERIC(6, 2)"), |
119 | | - (dy.Float(), "FLOAT"), |
120 | | - (dy.Float32(), "REAL"), |
121 | | - (dy.Float64(), "FLOAT"), |
122 | | - (dy.Integer(), "INTEGER"), |
123 | | - (dy.Int8(), "SMALLINT"), |
124 | | - (dy.Int16(), "SMALLINT"), |
125 | | - (dy.Int32(), "INTEGER"), |
126 | | - (dy.Int64(), "NUMBER(19)"), |
127 | | - (dy.UInt8(), "SMALLINT"), |
128 | | - (dy.UInt16(), "INTEGER"), |
129 | | - (dy.UInt32(), "NUMBER(19)"), |
130 | | - (dy.UInt64(), "NUMBER(19)"), |
131 | | - (dy.String(), "VARCHAR2"), |
132 | | - (dy.String(min_length=3), "VARCHAR2"), |
133 | | - (dy.String(max_length=5), "VARCHAR2(5 CHAR)"), |
134 | | - (dy.String(min_length=3, max_length=5), "VARCHAR2(5 CHAR)"), |
135 | | - (dy.String(min_length=5, max_length=5), "CHAR(5)"), |
136 | | - (dy.String(regex="[abc]de"), "VARCHAR2"), |
137 | | - (dy.String(regex="^[abc]d$"), "CHAR(2)"), |
138 | | - (dy.String(regex="^[abc]{1,3}d$"), "VARCHAR2(4 CHAR)"), |
139 | | - (dy.Enum(["foo", "bar"]), "CHAR(3)"), |
140 | | - (dy.Enum(["a", "abc"]), "VARCHAR2(3 CHAR)"), |
141 | | - ], |
142 | | -) |
143 | | -def test_oracle_datatype(column: Column, datatype: str) -> None: |
144 | | - dialect = OracleDialect_oracledb() |
145 | | - schema = create_schema("test", {"a": column}) |
146 | | - columns = schema.sql_schema(dialect) |
147 | | - assert len(columns) == 1 |
148 | | - assert columns[0].type.compile(dialect) == datatype |
149 | | - |
150 | | - |
151 | 105 | @pytest.mark.parametrize("column_type", COLUMN_TYPES) |
152 | 106 | @pytest.mark.parametrize("nullable", [True, False]) |
153 | 107 | @pytest.mark.parametrize("dialect", [MSDialect_pyodbc()]) |
|
0 commit comments