sql, stream - define wrapped_data to provide more clear errors

This commit is contained in:
Andrej730
2025-09-04 18:56:51 +05:00
parent 5f964bd33c
commit 15b69bfa98
2 changed files with 12 additions and 2 deletions
@@ -88,7 +88,6 @@ try:
class stream(file):
def __init__(self, filepath: str):
self.wrapped_data = None
self.history_size = 64
self.history = []
self.future = []
@@ -288,6 +287,12 @@ try:
# Override to avoid clean up unrelated to stream file.
pass
def wrapped_data(self) -> NoReturn:
class_name = str(type(self))
raise Exception(
f"No `wrapped_data` for {class_name}. `ifcopenshell.{class_name}` is probably confused with `ifcopenshell.file`."
)
@property
def schema(self) -> ifcopenshell.util.schema.IFC_SCHEMA:
return self._schema