Skip to content

Commit 7125a80

Browse files
kmadclaude
andcommitted
refactor: lazy-import dataframe_utils in QueryMetadata
Move the top-level import of dataframe_utils in core/types.py into QueryMetadata.__init__ so the module is only loaded when actually constructing query metadata, not on every import of rlm.core.types. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 663470e commit 7125a80

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎rlm/core/types.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
from types import ModuleType
33
from typing import Any, Literal
44

5-
from rlm.utils.dataframe_utils import dataframe_metadata, get_dataframe_type
6-
75
# Type alias for context payloads. At runtime this is Any (to accept pandas
86
# DataFrames without requiring pandas), but intended types are:
97
# str | dict[str, Any] | list[Any] | pd.DataFrame
@@ -271,6 +269,8 @@ class QueryMetadata:
271269
context_summary: str | None = None
272270

273271
def __init__(self, prompt: "ContextPayload"):
272+
from rlm.utils.dataframe_utils import dataframe_metadata, get_dataframe_type
273+
274274
df_type = get_dataframe_type(prompt)
275275
if df_type is not None:
276276
rows, cols = prompt.shape

0 commit comments

Comments
 (0)