Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2061/6 #2097

Merged
merged 8 commits into from
Nov 15, 2024
Merged

#2061/6 #2097

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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