Skip to content

Commit d993d5b

Browse files
committed
Avoid variable shadowing
1 parent 06b7044 commit d993d5b

File tree

11 files changed

+16
-36
lines changed

11 files changed

+16
-36
lines changed

pkg-py/docs/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919

2020
* The current SQL query and title can now be programmatically set through the `.sql()` and `.title()` methods of `QueryChat()`. (#98, #101)
2121

22+
* New `querychat.data` module provides sample datasets (`titanic()` and `tips()`) to make it easier to get started without external dependencies. (#118)
23+
2224
* Added a `.generate_greeting()` method to help you create a greeting message for your querychat bot. (#87)
2325

2426
* Added `querychat_reset_dashboard()` tool for easily resetting the dashboard filters when asked by the user. (#81)

pkg-py/docs/build.qmd

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ from shinywidgets import render_plotly
187187
from querychat.express import QueryChat
188188
from querychat.data import titanic
189189

190-
titanic = titanic()
191-
qc = QueryChat(titanic, "titanic")
190+
qc = QueryChat(titanic(), "titanic")
192191
qc.sidebar()
193192

194193
with ui.layout_columns():
@@ -227,8 +226,7 @@ from querychat.data import titanic
227226
from faicons import icon_svg
228227
import plotly.express as px
229228

230-
titanic = titanic()
231-
qc = QueryChat(titanic, "titanic")
229+
qc = QueryChat(titanic(), "titanic")
232230
qc.sidebar()
233231

234232
with ui.layout_column_wrap(fill=False):
@@ -358,10 +356,9 @@ from shiny.express import render, ui
358356
from querychat.express import QueryChat
359357
from querychat.data import titanic
360358

361-
titanic = titanic()
362359
penguins = load_dataset("penguins")
363360

364-
qc_titanic = QueryChat(titanic, "titanic")
361+
qc_titanic = QueryChat(titanic(), "titanic")
365362
qc_penguins = QueryChat(penguins, "penguins")
366363

367364
with ui.sidebar():
@@ -400,12 +397,9 @@ from querychat.express import QueryChat
400397
from querychat.data import titanic
401398
import plotly.express as px
402399

403-
# Load data
404-
titanic = titanic()
405-
406400
# Create QueryChat
407401
qc = QueryChat(
408-
titanic,
402+
titanic(),
409403
"titanic",
410404
data_description="Titanic passenger data with survival outcomes",
411405
)

pkg-py/docs/context.qmd

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ For full visibility into the full system prompt that Querychat generates for the
1414
from querychat import QueryChat
1515
from querychat.data import titanic
1616

17-
titanic = titanic()
18-
19-
qc = QueryChat(titanic, "titanic")
17+
qc = QueryChat(titanic(), "titanic")
2018
print(qc.system_prompt)
2119
```
2220

pkg-py/docs/data-sources.qmd

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,8 @@ import duckdb
162162
import pandas as pd
163163
from querychat.data import titanic
164164
165-
titanic = titanic()
166-
167165
conn = duckdb.connect("my_database.duckdb")
168-
conn.register('titanic_df', titanic)
166+
conn.register('titanic_df', titanic())
169167
conn.execute("""
170168
CREATE TABLE titanic AS
171169
SELECT * FROM titanic_df

pkg-py/docs/index.qmd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ The quickest way to start chatting is to call the `.app()` method, which returns
4343
from querychat import QueryChat
4444
from querychat.data import titanic
4545
46-
titanic = titanic()
47-
qc = QueryChat(titanic, "titanic", client="openai/gpt-4.1")
46+
qc = QueryChat(titanic(), "titanic", client="openai/gpt-4.1")
4847
app = qc.app()
4948
```
5049

pkg-py/docs/models.qmd

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ To use a particular model, pass a `"{provider}/{model}"` string to the `client`
1212
from querychat import QueryChat
1313
from querychat.data import titanic
1414

15-
titanic = titanic()
16-
1715
qc = QueryChat(
18-
titanic,
16+
titanic(),
1917
"titanic",
2018
client="anthropic/claude-sonnet-4-5"
2119
)

pkg-py/docs/tools.qmd

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ Here's a basic example of this tool in action with the `.app()` method. Notice h
2525
from querychat import QueryChat
2626
from querychat.data import titanic
2727
28-
titanic = titanic()
29-
qc = QueryChat(titanic, "titanic")
28+
qc = QueryChat(titanic(), "titanic")
3029
app = qc.app()
3130
```
3231

@@ -48,8 +47,7 @@ Here's an example of it in action:
4847
from querychat import QueryChat
4948
from querychat.data import titanic
5049
51-
titanic = titanic()
52-
qc = QueryChat(titanic, "titanic")
50+
qc = QueryChat(titanic(), "titanic")
5351
app = qc.app()
5452
```
5553

pkg-py/examples/01-hello-app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from querychat import QueryChat
22
from querychat.data import titanic
33

4-
titanic = titanic()
5-
qc = QueryChat(titanic, "titanic")
4+
qc = QueryChat(titanic(), "titanic")
65
app = qc.app()

pkg-py/examples/02-prompt-app.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
from querychat import QueryChat
44
from querychat.data import titanic
55

6-
titanic = titanic()
7-
86
greeting = Path(__file__).parent / "greeting.md"
97
data_desc = Path(__file__).parent / "data_description.md"
108

119
qc = QueryChat(
12-
titanic,
10+
titanic(),
1311
"titanic",
1412
greeting=greeting,
1513
data_description=data_desc,

pkg-py/examples/03-sidebar-core-app.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
from querychat import QueryChat
33
from querychat.data import titanic
44

5-
titanic = titanic()
6-
75
# 1. Provide data source to QueryChat
8-
qc = QueryChat(titanic, "titanic")
6+
qc = QueryChat(titanic(), "titanic")
97

108
app_ui = ui.page_sidebar(
119
# 2. Create sidebar chat control

0 commit comments

Comments
 (0)