Skip to content

Commit

Permalink
Merge pull request #2097 from mabel-dev/#2061/6
Browse files Browse the repository at this point in the history
  • Loading branch information
joocer authored Nov 15, 2024
2 parents 17f8230 + fecf7df commit 098e55b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
11 changes: 6 additions & 5 deletions opteryx/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@
import threading
import time

import opteryx
from opteryx.exceptions import MissingSqlStatement
from opteryx.utils.sql import clean_statement
from opteryx.utils.sql import remove_comments

sys.path.insert(1, os.path.join(sys.path[0], ".."))

if True:
import opteryx
from opteryx.exceptions import MissingSqlStatement
from opteryx.utils.sql import clean_statement
from opteryx.utils.sql import remove_comments


if readline:
pass
Expand Down
2 changes: 1 addition & 1 deletion opteryx/__version__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__build__ = 858
__build__ = 862

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Binary file added testdata/astronauts/astronauts.parquet
Binary file not shown.
5 changes: 4 additions & 1 deletion tests/misc/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

def run_cli(args):
"""Helper function to run the CLI and return the result."""
from tests.tools import find_file

path = find_file("**/__main__.py")
result = subprocess.run(
[sys.executable, "opteryx/__main__.py"] + args,
[sys.executable, path] + args,
capture_output=True,
text=True,
timeout=5
Expand Down
8 changes: 8 additions & 0 deletions tests/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def test_example():

import platform
from functools import wraps
from typing import Optional


def is_arm(): # pragma: no cover
Expand Down Expand Up @@ -179,6 +180,13 @@ def wrapper(*args, **kwargs):
return decorate


def find_file(path: str) -> Optional[str]:
import glob

matches = glob.iglob(path)
return next(matches, None)


def download_file(url: str, path: str): # pragma: no cover
"""
Download a file from a given URL and save it to a specified path.
Expand Down

0 comments on commit 098e55b

Please sign in to comment.