Skip to content

Commit c5728b3

Browse files
committed
feat: Prepend "querychat_" to automatic id
1 parent 5e5f879 commit c5728b3

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

pkg-py/src/querychat/_querychat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def __init__(
5858
"Table name must begin with a letter and contain only letters, numbers, and underscores",
5959
)
6060

61-
self.id = id or table_name
61+
self.id = id or f"querychat_{table_name}"
6262

6363
self.tools = normalize_tools(tools, default=("update", "query"))
6464
self.greeting = greeting.read_text() if isinstance(greeting, Path) else greeting

pkg-py/tests/test_client_console.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,5 +291,5 @@ def test_existing_initialization_still_works(self, sample_df):
291291
)
292292

293293
assert qc is not None
294-
assert qc.id == "test_table"
294+
assert qc.id == "querychat_test_table"
295295
assert qc.tools == ("update", "query")

pkg-py/tests/test_querychat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_querychat_init(sample_df):
3939

4040
# Verify basic attributes are set
4141
assert qc is not None
42-
assert qc.id == "test_table"
42+
assert qc.id == "querychat_test_table"
4343

4444
# Even without server initialization, we should be able to query the data source
4545
result = qc.data_source.execute_query(

pkg-r/R/QueryChat.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ QueryChat <- R6::R6Class(
178178

179179
private$.data_source <- normalize_data_source(data_source, table_name)
180180

181-
self$id <- id %||% table_name
181+
self$id <- id %||% sprintf("querychat_%s", table_name)
182182
self$tools <- tools
183183

184184
if (!is.null(greeting) && file.exists(greeting)) {

pkg-r/tests/testthat/test-QueryChat.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe("QueryChat$new()", {
4444
withr::defer(qc$cleanup())
4545

4646
expect_equal(qc$data_source$table_name, "my_data")
47-
expect_equal(qc$id, "my_data")
47+
expect_equal(qc$id, "querychat_my_data")
4848
})
4949

5050
it("loads greeting from file if file exists", {

0 commit comments

Comments
 (0)