@@ -12,8 +12,6 @@ class _ODSWriter(ExcelWriter):
12
12
engine = "odf"
13
13
supported_extensions = (".ods" ,)
14
14
15
- from odf .table import Table , TableCell , TableRow
16
-
17
15
def __init__ (
18
16
self , path : str , engine : Optional [str ] = None , mode : str = "w" , ** engine_kwargs
19
17
):
@@ -48,6 +46,7 @@ def write_cells(
48
46
"""
49
47
Write the frame cells using odf
50
48
"""
49
+ from odf .table import Table , TableCell , TableRow
51
50
from odf .text import P
52
51
53
52
sheet_name = self ._get_sheet_name (sheet_name )
@@ -110,7 +109,7 @@ def _make_table_cell_attributes(self, cell) -> Dict[str, object]:
110
109
attributes ["numbercolumnsspanned" ] = cell .mergeend
111
110
return attributes
112
111
113
- def _make_table_cell (self , cell ) -> Tuple [str , TableCell ]:
112
+ def _make_table_cell (self , cell ) -> Tuple [str , object ]:
114
113
"""Convert cell data to an OpenDocument spreadsheet cell
115
114
116
115
Parameters
@@ -123,6 +122,7 @@ def _make_table_cell(self, cell) -> Tuple[str, TableCell]:
123
122
pvalue, cell : Tuple[str, object]
124
123
Display value, Cell value
125
124
"""
125
+ from odf .table import TableCell
126
126
127
127
attributes = self ._make_table_cell_attributes (cell )
128
128
val , fmt = self ._value_with_fmt (cell .val )
0 commit comments