Skip to content

Commit

Permalink
Fix documentation and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
xzdandy committed Oct 7, 2023
1 parent b2b96cd commit 2ba8f97
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/source/reference/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To begin a querying session in EvaDB, obtain a connection with a cursor using ``
~evadb.connect
~evadb.EvaDBConnection.cursor
~evadb.EvaDBCursor.query
~evadb.EvaDBCursor.df
~evadb.EvaDBQuery.df

.. warning::

Expand Down
2 changes: 2 additions & 0 deletions evadb/interfaces/relational/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ def df(self) -> pandas.DataFrame:
speechrecognizer.response
0 "Sample Text from speech recognizer"
"""
# This df is only used by `create_vector_index`. All other APIs use the `df()` in EvaDBQuery.
if not self._result:
raise Exception("No valid result with the current cursor")
return self._result.frames
Expand Down Expand Up @@ -270,6 +271,7 @@ def create_vector_index(
"""
stmt = parse_create_vector_index(index_name, table_name, expr, using)
# TODO: move create_vector_index into EvaDBQuery.
self._result = execute_statement(self._evadb, stmt)
return self

Expand Down
6 changes: 5 additions & 1 deletion evadb/interfaces/relational/relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ def df(self, drop_alias: bool = True) -> pandas.DataFrame:
Example:
Runs a SQL query and get a panda Dataframe
>>> batch = cursor.query("SELECT * FROM MyTable;").df()
>>> cursor.query("SELECT * FROM MyTable;").df()
col1 col2
0 1 2
1 3 4
2 5 6
"""
batch = self.execute(drop_alias=drop_alias)
assert batch.frames is not None, "relation execute failed"
Expand Down

0 comments on commit 2ba8f97

Please sign in to comment.