Skip to content

Commit 273e217

Browse files
docs + benchmarks adjusted to meet new naming [ExecutionResult, ViewExecutionResult]. ->
1 parent 820066d commit 273e217

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

benchmark/dbally_benchmark/e2e_benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
async def _run_dbally_for_single_example(example: BIRDExample, collection: Collection) -> Text2SQLResult:
3232
try:
3333
result = await collection.ask(example.question, dry_run=True)
34-
sql = result.context["sql"]
34+
sql = result.metadata["sql"]
3535
except UnsupportedQueryError:
3636
sql = "UnsupportedQueryError"
3737
except NoViewFoundError:

docs/how-to/use_elastic_vector_store_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ async def main(country="United States", years_of_experience="2"):
9191
f"Find someone from the {country} with more than {years_of_experience} years of experience."
9292
)
9393

94-
print(f"The generated SQL query is: {result.context.get('sql')}")
94+
print(f"The generated SQL query is: {result.metadata.get('sql')}")
9595
print()
9696
print(f"Retrieved {len(result.results)} candidates:")
9797
for candidate in result.results:

docs/how-to/use_elasticsearch_store_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ async def main(country="United States", years_of_experience="2"):
9595
f"Find someone from the {country} with more than {years_of_experience} years of experience."
9696
)
9797

98-
print(f"The generated SQL query is: {result.context.get('sql')}")
98+
print(f"The generated SQL query is: {result.metadata.get('sql')}")
9999
print()
100100
print(f"Retrieved {len(result.results)} candidates:")
101101
for candidate in result.results:

docs/how-to/views/custom_views_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def execute(self, dry_run: bool = False) -> ViewExecutionResult:
6464
print(self._filter)
6565
filtered_data = list(filter(self._filter, self.get_data()))
6666

67-
return ViewExecutionResult(results=filtered_data, context={})
67+
return ViewExecutionResult(results=filtered_data, metadata={})
6868

6969
class CandidateView(FilteredIterableBaseView):
7070
def get_data(self) -> Iterable:

docs/quickstart/quickstart2_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ async def main():
8585

8686
result = await collection.ask("Find someone from the United States with more than 2 years of experience.")
8787

88-
print(f"The generated SQL query is: {result.context.get('sql')}")
88+
print(f"The generated SQL query is: {result.metadata.get('sql')}")
8989
print()
9090
print(f"Retrieved {len(result.results)} candidates:")
9191
for candidate in result.results:

docs/quickstart/quickstart_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async def main():
6363

6464
result = await collection.ask("Find me French candidates suitable for a senior data scientist position.")
6565

66-
print(f"The generated SQL query is: {result.context.get('sql')}")
66+
print(f"The generated SQL query is: {result.metadata.get('sql')}")
6767
print()
6868
print(f"Retrieved {len(result.results)} candidates:")
6969
for candidate in result.results:

0 commit comments

Comments
 (0)