Skip to content

Commit

Permalink
Merge pull request #2235 from mabel-dev/0.19.1-release
Browse files Browse the repository at this point in the history
0.19.1 release
  • Loading branch information
joocer authored Jan 12, 2025
2 parents 173aca1 + 6c56d51 commit 726408b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,4 @@ space_missions.parquet
**.psv
planets.parquet
tmp/iceberg/**
hits_split/*.parquet
2 changes: 1 addition & 1 deletion opteryx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
getcontext().prec = 28

# end-of-stream marker
EOS = object()
EOS: int = 0


def is_mac() -> bool: # pragma: no cover
Expand Down
4 changes: 2 additions & 2 deletions opteryx/__version__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__build__ = 976
__build__ = 979

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -22,7 +22,7 @@ class VersionStatus(Enum):
_major = 0
_minor = 19
_revision = 1
_status = VersionStatus.ALPHA
_status = VersionStatus.RELEASE

__author__ = "@joocer"
__version__ = f"{_major}.{_minor}.{_revision}" + (
Expand Down
4 changes: 3 additions & 1 deletion opteryx/connectors/disk_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
# Define os.O_BINARY for non-Windows platforms if it's not already defined
if not hasattr(os, "O_BINARY"):
os.O_BINARY = 0 # Value has no effect on non-Windows platforms
if not hasattr(os, "O_DIRECT"):
os.O_DIRECT = 0 # Value has no effect on non-Windows platforms


def read_blob(
Expand Down Expand Up @@ -69,7 +71,7 @@ def read_blob(
import mmap

try:
file_descriptor = os.open(blob_name, os.O_RDONLY | os.O_BINARY)
file_descriptor = os.open(blob_name, os.O_RDONLY | os.O_BINARY | os.O_DIRECT)
if hasattr(os, "posix_fadvise"):
os.posix_fadvise(file_descriptor, 0, 0, os.POSIX_FADV_WILLNEED)
size = os.fstat(file_descriptor).st_size
Expand Down
18 changes: 4 additions & 14 deletions opteryx/operators/show_columns_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,8 @@ def execute(self, morsel: pyarrow.Table, **kwargs) -> pyarrow.Table:
if self._full or self._extended:
# we're going to read the full table, so we can count stuff

if morsel == EOS:
dicts = self.collector.to_dicts()
dicts = [self.rename_column(d, self._column_map) for d in dicts]
self.seen = True
yield pyarrow.Table.from_pylist(dicts)
return
self.statistics.add_message("SHOW FULL/SHOW EXTENDED not implemented")

df = DataFrame.from_arrow(morsel)

if self.collector is None:
self.collector = df.profile
else:
self.collector += df.profile

yield None
self.seen = True
yield _simple_collector(self._schema)
return
12 changes: 6 additions & 6 deletions tests/sql_battery/test_shapes_and_errors_battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,10 +1033,10 @@
("SELECT name, id FROM $planets ORDER BY id LIMIT 100", 9, 2, None),

("SHOW COLUMNS FROM $satellites", 8, 4, None),
("SHOW FULL COLUMNS FROM $satellites", 8, 12, None),
("SHOW EXTENDED COLUMNS FROM $satellites", 8, 12, None),
("SHOW EXTENDED COLUMNS FROM $planets", 20, 12, None),
("SHOW EXTENDED COLUMNS FROM $astronauts", 19, 12, None),
("SHOW FULL COLUMNS FROM $satellites", 8, 4, None),
("SHOW EXTENDED COLUMNS FROM $satellites", 8, 4, None),
("SHOW EXTENDED COLUMNS FROM $planets", 20, 4, None),
("SHOW EXTENDED COLUMNS FROM $astronauts", 19, 4, None),
("SHOW COLUMNS FROM $satellites LIKE '%d'", 2, 4, UnsupportedSyntaxError),
("SHOW COLUMNS FROM testdata.partitioned.dated FOR '2024-02-03'", 8, 4, None),

Expand Down Expand Up @@ -2407,8 +2407,8 @@ def test_sql_battery(statement:str, rows:int, columns:int, exception: Optional[E
print(">", err)
failures.append((statement, err))

# print(opteryx.query(statement))
# raise err
print(opteryx.query(statement))
raise err

print("--- ✅ \033[0;32mdone\033[0m")

Expand Down

0 comments on commit 726408b

Please sign in to comment.