Visitar URL original
fix: Convert PdfBytes values to protos like ImageBytes by raashish1601 · Pull Request #6968 · feast-dev/feast · GitHub
Skip to content

fix: Convert PdfBytes values to protos like ImageBytes - #6968

Merged
haoxu0 merged 3 commits into
feast-dev:masterfrom
raashish1601:fix/pdf-bytes-proto-conversion
Oct 9, 2026
Merged

haoxu0 merged 3 commits into
feast-dev:masterfrom
raashish1601:fix/pdf-bytes-proto-conversion

Conversation

@raashish1601

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

ValueType.PDF_BYTES is missing from PYTHON_SCALAR_VALUE_TYPE_TO_PROTO_VALUE in type_map.py, while IMAGE_BYTES is there. So python_values_to_proto_values raises for any PdfBytes field, and a feature view with one can't be materialized or written to the online store:

fv = FeatureView(
    name="docs",
    entities=[doc],
    schema=[Field(name="doc_id", dtype=String), Field(name="pdf", dtype=PdfBytes)],
    source=FileSource(path=path, timestamp_field="event_timestamp"),
)
store.apply([doc, fv])
store.write_to_online_store("docs", df)   # same for store.materialize_incremental(...)
# Exception: Unsupported data type: ValueType.PDF_BYTES

The same feature view with ImageBytes instead works. This adds PDF_BYTES to the map with the same bytes_val conversion as BYTES and IMAGE_BYTES. Reading back already worked, since feast_value_type_to_python_type only looks at the proto field.

Which issue(s) this PR fixes:

No issue, found while checking value conversions for each ValueType.

Checks

  • I've made sure the tests are passing.
  • My commits are signed off (git commit -s)
  • My PR title follows conventional commits format

Testing Strategy

  • Unit tests
  • Integration tests

Added test_python_values_to_proto_values_binary in sdk/python/tests/unit/test_type_map.py for BYTES, PDF_BYTES and IMAGE_BYTES; the PDF_BYTES case fails on master. I also ran the example above against a local SQLite online store: write and materialize both work and get_online_features returns the bytes. pytest tests/unit/test_type_map.py passes apart from the TestSparkNativeTypeValidation cases, which fail the same way on master here because pyspark isn't installed. ruff check and ruff format --check are clean on the changed files.

PDF_BYTES was missing from PYTHON_SCALAR_VALUE_TYPE_TO_PROTO_VALUE, so
python_values_to_proto_values raised "Unsupported data type" for a
PdfBytes field, and a feature view with one could not be materialized
or written to the online store.

Signed-off-by: Raashish Aggarwal <94279692+raashish1601@users.noreply.github.com>
@raashish1601
raashish1601 requested a review from a team as a code owner October 7, 2026 23:48
@codecov-commenter

codecov-commenter commented Oct 7, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.92%. Comparing base (20bc993) to head (fb0d3c3).
⚠️ Report is 1 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6968   +/-   ##
=======================================
  Coverage   49.92%   49.92%           
=======================================
  Files         443      443           
  Lines       55511    55511           
  Branches     8096     8096           
=======================================
  Hits        27714    27714           
  Misses      25874    25874           
  Partials     1923     1923           
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 51.35% <ø> (ø)
Files with missing lines Coverage Δ
sdk/python/feast/type_map.py 64.59% <ø> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 20bc993...fb0d3c3. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@haoxu0 haoxu0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@haoxu0
haoxu0 merged commit af20fe4 into feast-dev:master Oct 9, 2026
19 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants