Skip to content

Ver0.6.30 - #424

Merged
joocer merged 8 commits into
mainfrom
ver0.6.30
Sep 20, 2026
Merged

joocer merged 8 commits into
mainfrom
ver0.6.30

Conversation

@joocer

@joocer joocer commented Sep 20, 2026

Copy link
Copy Markdown
Member

This pull request introduces several important improvements to how partitions and parquet files are handled in the codebase, along with corresponding updates to testing. The main themes are: (1) robust handling of partition identifiers by introducing a consistent hash function, (2) switching the parquet reader to use the rugo library instead of pyarrow and ensuring timestamp compatibility, and (3) improving schema handling for writing parquet files. Comprehensive tests have been added to validate these changes.

Partition handling improvements:

  • Introduced a new partition_hash function in cursor.py to consistently handle partition identifiers as either names or hashes, ensuring compatibility with xxhash 4.0 and preventing errors when comparing or hashing partition values (partition_hash function, and its use in load_cursor, next_blob, __getitem__) [1] [2] [3] [4].
  • Added a test to verify that partition lookups work correctly with both partition names and hashes, and that errors are raised for missing partitions (test_partition_lookup_accepts_name_or_hash in test_reader_cursor.py).

Parquet file reading and timestamp compatibility:

  • Switched the parquet reader implementation in decompressors.py from pyarrow to rugo, including logic to convert UTC-aware timestamps to naive datetimes to maintain compatibility with the rest of the codebase (parquet function in decompressors.py).
  • Added tests to ensure parquet files are read correctly and that timestamps are returned as naive datetimes (test_reader_can_read_parquet, test_parquet_timestamps_are_naive in test_reader_formats.py).

Schema handling for parquet writing:

  • Improved schema inference for writing parquet files: if any column type is missing, the schema is passed as a list of column names to allow type inference by orso, preventing failures when writing non-string data (blob_writer.py changes) [1] [2] [3].

Hashing for group-by keys:

  • Updated group-by key hashing to explicitly encode keys as UTF-8 bytes before passing to xxhash, ensuring compatibility with newer versions of xxhash (group_by.py).

These changes collectively improve the reliability and compatibility of partition handling and parquet file support, and ensure that future updates to dependencies like xxhash and rugo will not break core functionality.

joocer and others added 8 commits September 16, 2026 10:44
next_blob() resolved the active partition by comparing the xxh3 hash of each
readable blob against self.partition directly. self.partition holds a blob
name, not a hash, so that comparison could never match and the lookup could
only ever fall through to the ValueError.

Hash both sides before comparing, tolerating either representation - the name
that is held in memory, or the hash that a serialized cursor carries.

Add a test for the branch, which was previously uncovered. It pins both
representations so the isinstance guard isn't simplified away to an
unconditional hash, which would raise TypeError on an int partition.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Replace pyarrow with rugo.read_parquet and stream column-oriented
morsels into row dictionaries to avoid loading whole files. Convert
aware timestamps to naive UTC to match callers' expectations.

Normalize xxhash usage: encode strings to bytes for xxhash 4.0 and
add partition_hash to unify blob name vs stored-hash comparisons in
Cursor. Update GroupBy to pass bytes into xxh3_64_intdigest.

Allow orso to infer WAL column types when schema has missing types by
passing column names as wal_schema. Add rugo to requirements and
expand tests for parquet reading and cursor partition handling.
Delete Black and SonarCloud GitHub Actions and sonar-project file
Bump mypy/Black targets (3.11->3.13, py310->py311)
Improve typings and runtime type checks in validator and dates
Fix abstractclassmethod -> abstractmethod and avoid var shadowing
Remove DatabaseWriter.__del__ warning and tidy error rendering
@joocer
joocer merged commit 7835f09 into main Sep 20, 2026
7 of 8 checks passed
@joocer
joocer deleted the ver0.6.30 branch September 20, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant