Skip to content

Commit

Permalink
linted
Browse files Browse the repository at this point in the history
  • Loading branch information
americast committed Nov 25, 2023
1 parent c9a4470 commit 8f51878
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions evadb/parser/lark_visitor/_common_clauses_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ def full_id(self, tree):
return (self.visit(tree.children[0]), self.visit(tree.children[1]))

def uid(self, tree):
if (hasattr(tree.children[0],"type") and tree.children[0].type == "REVERSE_QUOTE_ID"):
if (
hasattr(tree.children[0], "type")
and tree.children[0].type == "REVERSE_QUOTE_ID"
):
tree.children[0].type = "simple_id"
non_tick_string = str(tree.children[0]).replace("`","")
non_tick_string = str(tree.children[0]).replace("`", "")
return non_tick_string
return self.visit(tree.children[0])

Expand Down
6 changes: 4 additions & 2 deletions test/integration_tests/short/test_load_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
import unittest
from pathlib import Path
from test.util import (
create_csv_with_comlumn_name_spaces,
create_dummy_csv_batches,
create_sample_csv,
create_csv_with_comlumn_name_spaces,
create_sample_video,
file_remove,
get_evadb_for_testing,
Expand Down Expand Up @@ -138,7 +138,9 @@ def test_should_load_csv_in_table_with_spaces_in_column_name(self):
execute_query_fetch_all(self.evadb, create_table_query)

# load the CSV
load_query = f"LOAD CSV '{create_csv_with_comlumn_name_spaces()}' INTO MyVideoCSV;"
load_query = (
f"LOAD CSV '{create_csv_with_comlumn_name_spaces()}' INTO MyVideoCSV;"
)
execute_query_fetch_all(self.evadb, load_query)

# execute a select query
Expand Down
3 changes: 2 additions & 1 deletion test/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ def create_sample_csv(num_frames=NUM_FRAMES):
df_sample_meta.to_csv(os.path.join(get_tmp_dir(), "dummy.csv"), index=False)
return os.path.join(get_tmp_dir(), "dummy.csv")


def create_csv_with_comlumn_name_spaces(num_frames=NUM_FRAMES):
try:
os.remove(os.path.join(get_tmp_dir(), "dummy.csv"))
Expand All @@ -334,7 +335,7 @@ def create_csv_with_comlumn_name_spaces(num_frames=NUM_FRAMES):
random_coords = 200 + 300 * np.random.random(4)
sample_meta[index] = {
"id": index,
"frame id": frame_id,
"frame id": frame_id,
"video id": video_id,
"dataset name": "test_dataset",
"label": sample_labels[np.random.choice(len(sample_labels))],
Expand Down

0 comments on commit 8f51878

Please sign in to comment.