Thanks to visit codestin.com
Credit goes to GitHub.com

Skip to content

Conversation

@anshishrivastava
Copy link

@anshishrivastava anshishrivastava commented Jan 27, 2026

Summary

Adds DynamoDB-specific list update functionality to avoid inefficient read-modify-write patterns for array-based features. This implements the solution requested in #5687.

Fixes #5687

Changes

  • Add update_online_store() and update_online_store_async() methods to DynamoDBOnlineStore class
  • Add corresponding methods to FeatureStore class for user-facing API
  • Support DynamoDB UpdateItem with list_append expressions for efficient array operations
  • Implement proper list serialization for all ValueProto list types
  • Add comprehensive unit tests for both DynamoDB online store and FeatureStore methods
  • Maintain 100% backward compatibility with existing write_to_online_store behavior
  • DynamoDB-specific functionality kept separate from core OnlineStore interface

Testing

  • Added comprehensive unit tests for DynamoDB online store update methods
  • Added FeatureStore integration tests for both sync and async methods
  • All tests pass and maintain backward compatibility.

Usage Example

# Append new transactions to existing transaction history
store.update_online_store(
    feature_view_name="user_transactions",
    df=new_transactions_df,
    update_expressions={
        "transaction_history": "list_append(transaction_history, :new_val)",
        "recent_amounts": "list_append(:new_val, recent_amounts)[:10]"  # sliding window
    }
)


<!-- devin-review-badge-begin -->

---

<a href="https://app.devin.ai/review/feast-dev/feast/pull/5916">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
    <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin">
  </picture>
</a>
<!-- devin-review-badge-end -->

@anshishrivastava anshishrivastava requested a review from a team as a code owner January 27, 2026 21:47
@anshishrivastava anshishrivastava changed the title feat: add DynamoDB in-place list update support for array-based features Feat: add DynamoDB in-place list update support for array-based features Jan 27, 2026
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

View issues and 4 additional flags in Devin Review.

Open in Devin Review

@anshishrivastava anshishrivastava force-pushed the feat/dynamodb-list-updates branch from a69361f to 45b218f Compare January 27, 2026 21:53
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View issue and 7 additional flags in Devin Review.

Open in Devin Review

@anshishrivastava anshishrivastava changed the title Feat: add DynamoDB in-place list update support for array-based features feat: add DynamoDB in-place list update support for array-based features Jan 27, 2026
@anshishrivastava anshishrivastava changed the title feat: add DynamoDB in-place list update support for array-based features feat: Add DynamoDB in-place list update support for array-based features Jan 27, 2026
@anshishrivastava
Copy link
Author

Reviewing the devin analysis

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View issue and 7 additional flags in Devin Review.

Open in Devin Review

@anshishrivastava anshishrivastava force-pushed the feat/dynamodb-list-updates branch 3 times, most recently from c3d81ed to eff9006 Compare January 29, 2026 22:27
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View issue and 10 additional flags in Devin Review.

Open in Devin Review

@anshishrivastava anshishrivastava force-pushed the feat/dynamodb-list-updates branch from eff9006 to 8221600 Compare January 29, 2026 22:47
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View issue and 11 additional flags in Devin Review.

Open in Devin Review

Copy link
Member

@franciscojavierarceo franciscojavierarceo left a comment

Choose a reason for hiding this comment

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

one small nit but otherwise this lgtm

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 2 new potential issues.

View issues and 15 additional flags in Devin Review.

Open in Devin Review

Anshi Shrivastava added 2 commits January 30, 2026 18:17
This PR adds support for in-place list updates (append/prepend) for
array-based features in DynamoDB online store, addressing issue feast-dev#5687.

Key changes:
- Add update_online_store() and update_online_store_async() methods to
  FeatureStore for list operations on existing feature values
- Implement read-modify-write pattern in DynamoDB store to handle list
  operations while maintaining compatibility with existing protobuf
  serialization format
- Add comprehensive tests for list append, prepend, mixed operations,
  and new entity handling

The implementation uses a read-modify-write approach because existing
data is stored as serialized protobuf bytes, not native DynamoDB lists.
This maintains backward compatibility with existing online_read methods.

Signed-off-by: Anshi Shrivastava <[email protected]>
Per reviewer feedback, removed the synchronous update_online_store method
and renamed update_online_store_async to update_online_store.

Signed-off-by: Anshi Shrivastava <[email protected]>
@anshishrivastava anshishrivastava force-pushed the feat/dynamodb-list-updates branch from c1cf89c to 9dd1ab9 Compare January 30, 2026 23:18
@anshishrivastava
Copy link
Author

@franciscojavierarceo -Thanks for the feedback on leaving the async version - updated. Feel free to merge, good to go.

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.

Add DynamoDB in-place list update support for array-based features

2 participants