Skip to content

Commit c8d4601

Browse files
authored
fix: default sampling strats to None for query, transform, chat (#179)
1 parent 545c1b3 commit c8d4601

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

docs/examples/mobject/table.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,16 @@ def update_sales(self, store: str, amount: str):
2828
header=0,
2929
index_col=False,
3030
)
31-
print(f"testing123 changes {store} to {amount}")
31+
# Remove unnamed columns and columns that don't exist.
32+
table_df.drop(table_df.filter(regex="Unname").columns, axis=1, inplace=True)
33+
34+
# Sometimes extra whitespace gets added to the column names and row values. Remove it.
35+
table_df.columns = table_df.columns.str.strip()
36+
table_df = table_df.map(lambda x: x.strip() if isinstance(x, str) else x)
37+
3238
table_df.loc[table_df["Store"] == store, "Sales"] = amount
33-
return MyCompanyDatabase(
34-
table=table_df.to_csv(sep="|", index=False, header=True)
35-
)
39+
self.table = table_df.to_csv(sep="|", index=False, header=True)
40+
return self
3641

3742
def transpose(self):
3843
"""Transpose the table."""

mellea/stdlib/funcs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ def chat(
335335
user_message,
336336
context=context,
337337
backend=backend,
338+
strategy=None,
338339
format=format,
339340
model_options=model_options,
340341
tool_calls=tool_calls,
@@ -468,6 +469,7 @@ def query(
468469
q,
469470
context=context,
470471
backend=backend,
472+
strategy=None,
471473
format=format,
472474
model_options=model_options,
473475
tool_calls=tool_calls,
@@ -511,6 +513,7 @@ def transform(
511513
t,
512514
context=context,
513515
backend=backend,
516+
strategy=None,
514517
format=format,
515518
model_options=model_options,
516519
tool_calls=True,

0 commit comments

Comments
 (0)