def test_is_time_druid_time_col(self): """Druid has a special __time column""" col = TableColumn(column_name="__time", type="INTEGER") self.assertEqual(col.is_dttm, None) DruidEngineSpec.alter_new_orm_column(col) self.assertEqual(col.is_dttm, True) col = TableColumn(column_name="__not_time", type="INTEGER") self.assertEqual(col.is_time, False)
def test_is_time_druid_time_col(self): """Druid has a special __time column""" database = Database(database_name="druid_db", sqlalchemy_uri="druid://db") tbl = SqlaTable(table_name="druid_tbl", database=database) col = TableColumn(column_name="__time", type="INTEGER", table=tbl) self.assertEqual(col.is_dttm, None) DruidEngineSpec.alter_new_orm_column(col) self.assertEqual(col.is_dttm, True) col = TableColumn(column_name="__not_time", type="INTEGER", table=tbl) self.assertEqual(col.is_temporal, False)