Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
xzdandy committed Sep 29, 2023
1 parent 27a3392 commit 29259c5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion evadb/catalog/catalog_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def check_native_table_exists(self, table_name: str, database_name: str):
resp = handler.get_tables()

if resp.error is not None:
return False
raise Exception(resp.error)

# Check table existence.
table_df = resp.data
Expand Down
2 changes: 1 addition & 1 deletion evadb/storage/native_storage_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def read(
# we prefer the generator/iterator when available
result = []
if handler_response.data_generator:
result = handler_response.data_generator()
result = [next(handler_response.data_generator)]
elif handler_response.data:
result = handler_response.data

Expand Down
18 changes: 9 additions & 9 deletions evadb/third_party/databases/github/github_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ def __init__(self, name: str, **kwargs):

@property
def supported_table(self):

def _stargazer_generator():
for stargazer in self.connection.get_repo("{}/{}".format(self.owner, self.repo)).get_stargazers():
yield {
property_name: getattr(stargazer, property_name)
for property_name, _ in STARGAZERS_COLUMNS
}

mapping = {
"stargazers": {
"columns": STARGAZERS_COLUMNS,
"generator": lambda: [
{
property_name: getattr(stargazer, property_name)
for property_name, _ in STARGAZERS_COLUMNS
}
for stargazer in self.connection.get_repo(
"{}/{}".format(self.owner, self.repo)
).get_stargazers()[:1]
],
"generator": _stargazer_generator(),
},
}
return mapping
Expand Down
1 change: 0 additions & 1 deletion test/third_party_tests/test_github_datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def test_should_run_select_query_in_github(self):
params = {
"owner": "georgia-tech-db",
"repo": "evadb",
"github_token": "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",
}
query = f"""CREATE DATABASE github_data
WITH ENGINE = "github",
Expand Down

0 comments on commit 29259c5

Please sign in to comment.