1
1
""" test orc compat """
2
2
import datetime
3
- from distutils .version import LooseVersion
4
3
import os
5
- from warnings import catch_warnings
6
4
7
5
import numpy as np
8
- import pytest
9
-
10
- import pandas .util ._test_decorators as td
11
-
12
6
import pandas as pd
13
7
import pandas .util .testing as tm
14
-
8
+ import pytest
15
9
from pandas .io .orc import PyArrowImpl , get_engine , read_orc
16
10
17
11
try :
@@ -69,7 +63,7 @@ def test_invalid_engine(dirpath):
69
63
inputfile = os .path .join (dirpath , "TestOrcFile.emptyFile.orc" )
70
64
engine = "foo"
71
65
with pytest .raises (ValueError ):
72
- pd . read_orc (inputfile , engine = engine , columns = ["boolean1" ])
66
+ read_orc (inputfile , engine = engine , columns = ["boolean1" ])
73
67
74
68
75
69
def test_orc_reader_empty (dirpath , engine ):
@@ -100,7 +94,7 @@ def test_orc_reader_empty(dirpath, engine):
100
94
expected [colname ] = pd .Series (dtype = dtype )
101
95
102
96
inputfile = os .path .join (dirpath , "TestOrcFile.emptyFile.orc" )
103
- got = pd . read_orc (inputfile , engine = engine , columns = columns )
97
+ got = read_orc (inputfile , engine = engine , columns = columns )
104
98
105
99
tm .assert_equal (expected , got )
106
100
@@ -120,7 +114,7 @@ def test_orc_reader_basic(dirpath, engine):
120
114
expected = pd .DataFrame .from_dict (data )
121
115
122
116
inputfile = os .path .join (dirpath , "TestOrcFile.test1.orc" )
123
- got = pd . read_orc (inputfile , engine = engine , columns = data .keys ())
117
+ got = read_orc (inputfile , engine = engine , columns = data .keys ())
124
118
125
119
tm .assert_equal (expected , got )
126
120
@@ -149,7 +143,7 @@ def test_orc_reader_decimal(dirpath, engine):
149
143
expected = pd .DataFrame .from_dict (data )
150
144
151
145
inputfile = os .path .join (dirpath , "TestOrcFile.decimal.orc" )
152
- got = pd . read_orc (inputfile , engine = engine ).iloc [:10 ]
146
+ got = read_orc (inputfile , engine = engine ).iloc [:10 ]
153
147
154
148
tm .assert_equal (expected , got )
155
149
@@ -190,7 +184,7 @@ def test_orc_reader_date_low(dirpath, engine):
190
184
expected = pd .DataFrame .from_dict (data )
191
185
192
186
inputfile = os .path .join (dirpath , "TestOrcFile.testDate1900.orc" )
193
- got = pd . read_orc (inputfile , engine = engine ).iloc [:10 ]
187
+ got = read_orc (inputfile , engine = engine ).iloc [:10 ]
194
188
195
189
tm .assert_equal (expected , got )
196
190
@@ -231,7 +225,7 @@ def test_orc_reader_date_high(dirpath, engine):
231
225
expected = pd .DataFrame .from_dict (data )
232
226
233
227
inputfile = os .path .join (dirpath , "TestOrcFile.testDate2038.orc" )
234
- got = pd . read_orc (inputfile , engine = engine ).iloc [:10 ]
228
+ got = read_orc (inputfile , engine = engine ).iloc [:10 ]
235
229
236
230
tm .assert_equal (expected , got )
237
231
@@ -272,6 +266,6 @@ def test_orc_reader_snappy_compressed(dirpath, engine):
272
266
expected = pd .DataFrame .from_dict (data )
273
267
274
268
inputfile = os .path .join (dirpath , "TestOrcFile.testSnappy.orc" )
275
- got = pd . read_orc (inputfile , engine = engine ).iloc [:10 ]
269
+ got = read_orc (inputfile , engine = engine ).iloc [:10 ]
276
270
277
271
tm .assert_equal (expected , got )
0 commit comments