| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
⚠️ Please install the Codecov Report❌ Patch coverage is 97.61905% with 1 line in your changes missing coverage. Please review.
@@ Coverage Diff @@
## master #6925 +/- ##
==========================================
+ Coverage 48.64% 48.68% +0.04%
==========================================
Files 427 427
Lines 53864 53906 +42
Branches 7849 7858 +9
==========================================
+ Hits 26203 26246 +43
+ Misses 25792 25788 -4
- Partials 1869 1872 +3
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
|
@ntkathole PTAL, It's a simple one |
Sorry, something went wrong.
Extends the existing TableFormat abstraction (feast-dev#5650) with Lance rather than introducing a separate data source, so Lance is addressed the same way Iceberg, Delta and Hudi already are. Closes part of feast-dev#6899. LanceFormat carries catalog/namespace addressing plus an optional pin to a dataset version or tag. Because SparkSource already drives its reader generically from table_format.format_type.value and table_format.properties, this works with SparkSource with no changes to it: format_type.value is "lance", and the pin is mirrored into properties as lance.version / lance.tag. version is validated as >= 1 so the Python and proto semantics agree. Lance dataset versions start at 1 and the proto treats 0 as unset, so without that guard version=0 would not round-trip, since to_proto/from_proto read 0 as absent. version and tag are mutually exclusive, because a tag already resolves to a version. Only DataFormat_pb2 is regenerated, using grpcio-tools 1.62.3 so the emitted gencode stays at the 4.25.1 level the other checked-in protos use. Regenerating with the pinned grpcio-tools 1.84.0 instead emits gencode that calls ValidateProtobufRuntimeVersion for protobuf 7.35.1, which would break the declared protobuf>=4.24.0 floor for that one module. DataSource_pb2 is deliberately left untouched. It is already stale against DataSource.proto on master, missing ConnectionRef entries, and regenerating it produces ~125 lines of churn unrelated to this change. Signed-off-by: hao-xu5 <hxu44@apple.com>
Adds LanceSource and teaches the DuckDB offline store to read it, completing the read half of feast-dev#6899. LanceFormat landed in feast-dev#6925 as a format descriptor; nothing read Lance until now. Lance already worked through SparkSource, which drives its reader generically from table_format.format_type.value and table_format.properties. What was missing is a path that needs no JVM, which is also the real test of whether the DataSource abstraction is engine-agnostic rather than Spark-agnostic in name only. Placement: a new source read by the existing DuckDB store, rather than a Lance offline store or an extension of FileSource. FileSource is the wrong host. Its format axis is already taken by file_format, so adding table_format would give one source two overlapping format axes. It is also read by two stores with incompatible contracts: duckdb._read_data_source dispatches on type, while dask._read_datasource has no dispatch seam and reads file_options.uri unconditionally as Parquet, and asserts isinstance(..., FileSource) in three places. Decisively, Lance's catalog addressing has no path to put in FileSource.path, so the catalog-based layer would not fit the class even if the path-based one did. A Lance offline store would be the wrong 120 lines. duckdb.py is a binding that injects reader and writer callbacks into the engine in ibis.py, so a Lance store would be a near-copy of it plus a repo_config entry, and would force a choice between Lance and Parquet instead of mixing them in one feature service. Reading a source as ibis.memtable(arrow_table) in the DuckDB store already has two precedents, IcebergSource and MlflowDatasetSource. Following them leaves ibis.py untouched, so the point-in-time join, TTL handling, field mapping and ODFVs work unchanged, and no edit to repo_config.py or data_source.py is needed because CUSTOM_SOURCE plus data_source_class_type is self-describing. Both addressing modes work: a uri, and catalog/namespace/table through namespace_client and table_id. Pin semantics follow what was argued on feast-dev#5782 and feast-dev#6925: a pin selects data, never shape. get_table_column_names_and_types reads the pinned schema so feast apply infers what reads will actually see; a pre-flight check fails with a message naming the pin when a pinned version cannot satisfy the declared schema; and vector widths go through _validate_vector_field_lengths from feast-dev#6909 rather than a second validator. Tests use the dir namespace implementation, which exercises the same namespace_client and table_id code path as a remote catalog with no server required. 43 tests, including a demonstration that a tag pin returns earlier data after the dataset has been overwritten for the same entity and timestamp. Read-only for now: _write_data_source is untouched, so a LanceSource is not yet a persist target and there is no SavedDatasetLanceStorage. Signed-off-by: hao-xu5 <hxu44@apple.com>
* feat: Add a non-JVM read path for Lance data sources Adds LanceSource and teaches the DuckDB offline store to read it, completing the read half of #6899. LanceFormat landed in #6925 as a format descriptor; nothing read Lance until now. Lance already worked through SparkSource, which drives its reader generically from table_format.format_type.value and table_format.properties. What was missing is a path that needs no JVM, which is also the real test of whether the DataSource abstraction is engine-agnostic rather than Spark-agnostic in name only. Placement: a new source read by the existing DuckDB store, rather than a Lance offline store or an extension of FileSource. FileSource is the wrong host. Its format axis is already taken by file_format, so adding table_format would give one source two overlapping format axes. It is also read by two stores with incompatible contracts: duckdb._read_data_source dispatches on type, while dask._read_datasource has no dispatch seam and reads file_options.uri unconditionally as Parquet, and asserts isinstance(..., FileSource) in three places. Decisively, Lance's catalog addressing has no path to put in FileSource.path, so the catalog-based layer would not fit the class even if the path-based one did. A Lance offline store would be the wrong 120 lines. duckdb.py is a binding that injects reader and writer callbacks into the engine in ibis.py, so a Lance store would be a near-copy of it plus a repo_config entry, and would force a choice between Lance and Parquet instead of mixing them in one feature service. Reading a source as ibis.memtable(arrow_table) in the DuckDB store already has two precedents, IcebergSource and MlflowDatasetSource. Following them leaves ibis.py untouched, so the point-in-time join, TTL handling, field mapping and ODFVs work unchanged, and no edit to repo_config.py or data_source.py is needed because CUSTOM_SOURCE plus data_source_class_type is self-describing. Both addressing modes work: a uri, and catalog/namespace/table through namespace_client and table_id. Pin semantics follow what was argued on #5782 and #6925: a pin selects data, never shape. get_table_column_names_and_types reads the pinned schema so feast apply infers what reads will actually see; a pre-flight check fails with a message naming the pin when a pinned version cannot satisfy the declared schema; and vector widths go through _validate_vector_field_lengths from #6909 rather than a second validator. Tests use the dir namespace implementation, which exercises the same namespace_client and table_id code path as a remote catalog with no server required. 43 tests, including a demonstration that a tag pin returns earlier data after the dataset has been overwritten for the same entity and timestamp. Read-only for now: _write_data_source is untouched, so a LanceSource is not yet a persist target and there is no SavedDatasetLanceStorage. Signed-off-by: hao-xu5 <hxu44@apple.com> * fix: Address Lance read review feedback Signed-off-by: HaoXuAI <sduxuhao@gmail.com> --------- Signed-off-by: hao-xu5 <hxu44@apple.com> Signed-off-by: HaoXuAI <sduxuhao@gmail.com>
| Back | FazBrowse Home | New Git URL |
Adds Lance to the existing TableFormat abstraction from #5650, rather than introducing a separate data source. Addresses the core of #6899.
Why TableFormat and not a new source
TableFormat already models Iceberg, Delta and Hudi as formats a source can carry, with catalog/namespace addressing and a properties bag. Lance fits that shape exactly, so it needs no new source class, no new offline store, and no changes to any existing consumer.
It works with SparkSource unchanged
SparkSource already drives its reader generically:
So mirroring the pin into properties is what makes this fall out for free. Verified:
SparkSource accepted it : LanceFormat spark .format(...) value : lance reader .option(...) pairs : lance.catalog = polaris_dev lance.namespace = ml_features lance.version = 3 SparkSource proto rt : LanceFormat version = 3Pin semantics
version / tag is the Lance-shaped instance of #5782. Two invariants:
On the broader question @jfw-ppi raised in #5782 — whether a pin can change the response shape — the position I'd argue for is that a pin selects data, never shape: the declared FeatureView schema stays the contract, and a pinned version whose schema disagrees should fail explicitly. That belongs in whatever consumes the pin, so it is not in this PR, but the format carries enough information to enforce it.
Proto regeneration, deliberately constrained
Two things worth flagging, both about not doing the obvious thing.
1. Generated with grpcio-tools==1.62.3, not the pinned 1.84.0.
Regenerating with the pinned toolchain emits gencode that opens with:
pyproject.toml declares protobuf>=4.24.0. That call would hard-fail for anyone on protobuf 4/5/6 — and google.protobuf.runtime_version does not exist in 4.x at all, so it is an ImportError on that one module while every other proto still imports. Using 1.62.3 emits 4.25.1-level gencode, matching every other checked-in proto, and keeps the declared floor honest.
Worth noting independently: the checked-in protos are at gencode 4.25.1 while the requirements pin grpcio-tools==1.84.0 / protobuf==7.36.2, so a full regeneration on master today would touch ~70 files and raise the effective protobuf floor. That looks like something to decide on purpose rather than as a side effect of a feature PR.
2. DataSource_pb2 is left untouched on purpose.
Regenerating also rewrites DataSource_pb2.py/.pyi (~125 lines), but that churn is pre-existing — I verified it reproduces on pristine master with no changes at all. The checked-in copy is missing _CONNECTIONREF_PARAMSENTRY entries, i.e. it is stale against DataSource.proto. Happy to fix that separately; it does not belong here.
Net result is 5 files, and only DataFormat_pb2 regenerated.
Scope
This adds the format descriptor. It does not add a Lance reader or offline store — that is the follow-on discussed in #6899, and it is why the tests here cover LanceFormat semantics rather than reading real datasets (no new test dependency on pylance).
Also explicitly not proposing Lance as an online store: it is a format plus indexes, not a low-latency KV service, and its write path is columnar while online_write_batch is row-oriented proto.
Testing
11 new tests in test_table_format.py (24 total in the file): creation, minimal construction, version pin, tag pin, version < 1 rejection, version+tag rejection, dict/json/proto round-trips, unpinned not coming back as version 0, and factory dispatch.
Related: #6899, #5782, #5650, #6499