Skip to content

fix: Use table_format when writing to path-based SparkSource in offline_write_batch - #7055

Open
Mrun25 wants to merge 1 commit into
feast-dev:masterfrom
Mrun25:fix-spark-offline-write-table-format-6955
Open

Mrun25 wants to merge 1 commit into
feast-dev:masterfrom
Mrun25:fix-spark-offline-write-table-format-6955

Conversation

@Mrun25

@Mrun25 Mrun25 commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

What this PR does

SparkOfflineStore.offline_write_batch only looked at file_format for path-based SparkSources. A source configured with table_format (for example Delta) and no file_format was read and written with format(None).

The existing-data read now goes through SparkSource._load_dataframe_from_path, the same code the retrieval path uses. The write uses table_format.format_type and its properties when table_format is set, and falls back to file_format otherwise, so sources without a table format behave as before.

Testing

Added test_spark_offline_write_batch.py covering file_format only, table_format only (with options), and table_format taking precedence. The new tests fail without the change and pass with it.

Fixes #6955

@Mrun25
Mrun25 requested a review from a team as a code owner October 21, 2026 04:36
Copilot AI balanced review requested due to automatic review settings October 21, 2026 04:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

3 open issues

Review effort: Lite

Comment on lines +399 to +401
df_existing = feature_view.batch_source._load_dataframe_from_path(
spark_session
)
else:
writer = df_batch.write.format(table_format.format_type.value)
for key, value in table_format.properties.items():
writer = writer.option(key, value)
Comment on lines +74 to +77
writer.format.return_value.option.assert_called_once_with(
"delta.checkpointLocation", "/tmp/ckpt"
)
option_writer = writer.format.return_value.option.return_value
@codecov-commenter

codecov-commenter commented Nov 4, 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 52.47%. Comparing base (4ff05d7) to head (18bcaf5).
⚠️ Report is 3 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    #7055      +/-   ##
==========================================
+ Coverage   52.39%   52.47%   +0.08%     
==========================================
  Files         459      459              
  Lines       58153    58178      +25     
  Branches     8570     8579       +9     
==========================================
+ Hits        30468    30530      +62     
+ Misses      25606    25562      -44     
- Partials     2079     2086       +7     
Flag Coverage Δ
go-feature-server 30.96% <ø> (ø)
python-unit 53.98% <100.00%> (+0.08%) ⬆️
Files with missing lines Coverage Δ
...ffline_stores/contrib/spark_offline_store/spark.py 37.48% <100.00%> (+2.05%) ⬆️

... and 6 files with indirect coverage changes


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 4714523...18bcaf5. 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.

@Mrun25 Mrun25 changed the title fix: use table_format when writing to path-based SparkSource in offline_write_batch fix: Use table_format when writing to path-based SparkSource in offline_write_batch Nov 4, 2026
@ntkathole
ntkathole force-pushed the fix-spark-offline-write-table-format-6955 branch from c4bf90d to 18bcaf5 Compare November 13, 2026 14:01

This branch has not been deployed

No deployments
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.

SparkOfflineStore.offline_write_batch ignores table_format and writes with file_format

4 participants