File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1515# specific language governing permissions and limitations
1616# under the License.
1717
18+ from typing import Any
19+
20+ import pytest
21+
22+ from pyiceberg .io .fileformat import DataFileStatistics , FileFormatWriter
23+
1824
1925def test_backward_compat_import () -> None :
2026 """DataFileStatistics can still be imported from pyiceberg.io.pyarrow."""
2127 from pyiceberg .io .fileformat import DataFileStatistics as dFS # noqa: F401
2228 from pyiceberg .io .pyarrow import DataFileStatistics # noqa: F401
2329
2430 assert DataFileStatistics is dFS
31+
32+
33+ def test_result_before_close_raises () -> None :
34+ """Calling result before close should raise an error."""
35+
36+ class _DummyWriter (FileFormatWriter ):
37+ def write (self , table : Any ) -> None :
38+ pass
39+
40+ def close (self ) -> DataFileStatistics :
41+ raise NotImplementedError
42+
43+ writer = _DummyWriter ()
44+ with pytest .raises (RuntimeError , match = "Writer has not been closed yet" ):
45+ writer .result ()
You can’t perform that action at this time.
0 commit comments