update and cleanup repo
This commit is contained in:
@@ -35,21 +35,21 @@ class ResultModel:
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ResultTable:
|
||||
"""Concrete, provider-owned table of rows/columns.
|
||||
"""Concrete, plugin-owned table of rows/columns.
|
||||
|
||||
This is intentionally minimal: it only stores rows, column specs, and
|
||||
optional metadata used by renderers. It does not auto-normalize legacy
|
||||
objects or infer columns.
|
||||
"""
|
||||
|
||||
provider: str
|
||||
plugin: str
|
||||
rows: List[ResultModel]
|
||||
columns: List[ColumnSpec]
|
||||
meta: Dict[str, Any] = field(default_factory=dict)
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
if not str(self.provider or "").strip():
|
||||
raise ValueError("provider required for ResultTable")
|
||||
if not str(self.plugin or "").strip():
|
||||
raise ValueError("plugin required for ResultTable")
|
||||
object.__setattr__(self, "rows", [ensure_result_model(r) for r in self.rows])
|
||||
if not self.columns:
|
||||
raise ValueError("columns are required for ResultTable")
|
||||
@@ -70,7 +70,7 @@ class ResultTable:
|
||||
"ext": r.ext,
|
||||
"size_bytes": r.size_bytes,
|
||||
"metadata": r.metadata or {},
|
||||
"source": r.source or self.provider,
|
||||
"source": r.source or self.plugin,
|
||||
"_selection_args": list(selection or []),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user