Commit c2529b9
authored
Break circular import (apache#1639)
Sometime I'm seeing this:
```
ImportError while loading conftest '/home/runner/work/iceberg-python/iceberg-python/tests/conftest.py'.
tests/conftest.py:52: in <module>
from pyiceberg.catalog import Catalog, load_catalog
pyiceberg/catalog/__init__.py:51: in <module>
from pyiceberg.serializers import ToOutputFile
pyiceberg/serializers.py:25: in <module>
from pyiceberg.table.metadata import TableMetadata, TableMetadataUtil
pyiceberg/table/__init__.py:65: in <module>
from pyiceberg.io.pyarrow import ArrowScan, schema_to_pyarrow
pyiceberg/io/pyarrow.py:141: in <module>
from pyiceberg.table.locations import load_location_provider
pyiceberg/table/locations.py:25: in <module>
from pyiceberg.table import TableProperties
E ImportError: cannot import name 'TableProperties' from partially initialized module 'pyiceberg.table' (most likely due to a circular import) (/home/runner/work/iceberg-python/iceberg-python/pyiceberg/table/__init__.py)
```
Also observed in: apache#1388
I prefer the imports at the top, but I think this is a small price to
pay to avoid having circular imports.1 parent ec4e65f commit c2529b9
1 file changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
| 48 | + | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| 89 | + | |
| 90 | + | |
88 | 91 | | |
89 | 92 | | |
90 | 93 | | |
| |||
131 | 134 | | |
132 | 135 | | |
133 | 136 | | |
| 137 | + | |
| 138 | + | |
134 | 139 | | |
135 | 140 | | |
136 | 141 | | |
| |||
144 | 149 | | |
145 | 150 | | |
146 | 151 | | |
| 152 | + | |
| 153 | + | |
147 | 154 | | |
148 | 155 | | |
149 | 156 | | |
| |||
0 commit comments