Repository navigation
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
rugolibrary instead ofpyarrowand ensuring timestamp compatibility, and (3) improving schema handling for writing parquet files. Comprehensive tests have been added to validate these changes.Partition handling improvements:
partition_hashfunction incursor.pyto consistently handle partition identifiers as either names or hashes, ensuring compatibility withxxhash4.0 and preventing errors when comparing or hashing partition values (partition_hashfunction, and its use inload_cursor,next_blob,__getitem__) [1] [2] [3] [4].test_partition_lookup_accepts_name_or_hashintest_reader_cursor.py).Parquet file reading and timestamp compatibility:
decompressors.pyfrompyarrowtorugo, including logic to convert UTC-aware timestamps to naive datetimes to maintain compatibility with the rest of the codebase (parquetfunction indecompressors.py).test_reader_can_read_parquet,test_parquet_timestamps_are_naiveintest_reader_formats.py).Schema handling for parquet writing:
orso, preventing failures when writing non-string data (blob_writer.pychanges) [1] [2] [3].Hashing for group-by keys:
xxhash, ensuring compatibility with newer versions ofxxhash(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
xxhashandrugowill not break core functionality.