Skip to content

[TASK-289] Partitioned KV tables python example#290

Open
fresh-borzoni wants to merge 1 commit intoapache:mainfrom
fresh-borzoni:partitioned-kv-python
Open

[TASK-289] Partitioned KV tables python example#290
fresh-borzoni wants to merge 1 commit intoapache:mainfrom
fresh-borzoni:partitioned-kv-python

Conversation

@fresh-borzoni
Copy link
Contributor

closes #289

Added example mirroring rust tests

@fresh-borzoni
Copy link
Contributor Author

@leekeiabstraction @luoyuxia PTAL 🙏

Copy link
Contributor

@leekeiabstraction leekeiabstraction left a comment

Choose a reason for hiding this comment

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

TY for the PR! Left comments, PTAL

Comment on lines +769 to +771
part_kv_fields = [
pa.field("region", pa.string()), # partition key + part of PK
pa.field("user_id", pa.int32()), # part of PK
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: What do we mean by part here? Part (as in subset) or partitioned?

part_kv_fields can be confusing, if I recall correctly prefix lookup uses subset of primary keys and this can be misconstrued. It seems like we're using all of the primary keys.

Comment on lines +840 to +843
print("\n--- Lookup in non-existent partition ---")
result = await lookuper.lookup({"region": "UNKNOWN", "user_id": 1})
assert result is None, "Expected UNKNOWN partition lookup to return None"
print("UNKNOWN partition lookup: not found (expected)")
Copy link
Contributor

@leekeiabstraction leekeiabstraction Feb 8, 2026

Choose a reason for hiding this comment

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

Does this currently return? If I recall correctly, we adhere to Java side which has effectively infinite retry for retry-able error, PartitionNotFound being one of them

Sorry, I was thinking about upsert path. Lookup should be OK

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 partitioned KV tables to Python bindings example

2 participants