Skip to content

Commit

Permalink
docs + benchmarks adjusted to meet new naming [ExecutionResult, ViewE…
Browse files Browse the repository at this point in the history
…xecutionResult]."context" -> "metadata"
  • Loading branch information
ds-jakub-cierocki committed Jul 15, 2024
1 parent 820066d commit 25fbfa6
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion benchmark/dbally_benchmark/e2e_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
async def _run_dbally_for_single_example(example: BIRDExample, collection: Collection) -> Text2SQLResult:
try:
result = await collection.ask(example.question, dry_run=True)
sql = result.context["sql"]
sql = result.metadata["sql"]
except UnsupportedQueryError:
sql = "UnsupportedQueryError"
except NoViewFoundError:
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/use_elastic_vector_store_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async def main(country="United States", years_of_experience="2"):
f"Find someone from the {country} with more than {years_of_experience} years of experience."
)

print(f"The generated SQL query is: {result.context.get('sql')}")
print(f"The generated SQL query is: {result.metadata.get('sql')}")
print()
print(f"Retrieved {len(result.results)} candidates:")
for candidate in result.results:
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/use_elasticsearch_store_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async def main(country="United States", years_of_experience="2"):
f"Find someone from the {country} with more than {years_of_experience} years of experience."
)

print(f"The generated SQL query is: {result.context.get('sql')}")
print(f"The generated SQL query is: {result.metadata.get('sql')}")
print()
print(f"Retrieved {len(result.results)} candidates:")
for candidate in result.results:
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/views/custom_views_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def execute(self, dry_run: bool = False) -> ViewExecutionResult:
print(self._filter)
filtered_data = list(filter(self._filter, self.get_data()))

return ViewExecutionResult(results=filtered_data, context={})
return ViewExecutionResult(results=filtered_data, metadata={})

class CandidateView(FilteredIterableBaseView):
def get_data(self) -> Iterable:
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart/quickstart2_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async def main():

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

print(f"The generated SQL query is: {result.context.get('sql')}")
print(f"The generated SQL query is: {result.metadata.get('sql')}")
print()
print(f"Retrieved {len(result.results)} candidates:")
for candidate in result.results:
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart/quickstart_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async def main():

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

print(f"The generated SQL query is: {result.context.get('sql')}")
print(f"The generated SQL query is: {result.metadata.get('sql')}")
print()
print(f"Retrieved {len(result.results)} candidates:")
for candidate in result.results:
Expand Down

0 comments on commit 25fbfa6

Please sign in to comment.