Skip to content

feat: add branch/tag metadata maps and tag timestamps#6364

Open
majin1102 wants to merge 3 commits intolance-format:mainfrom
majin1102:add_metadata_field
Open

feat: add branch/tag metadata maps and tag timestamps#6364
majin1102 wants to merge 3 commits intolance-format:mainfrom
majin1102:add_metadata_field

Conversation

@majin1102
Copy link
Copy Markdown
Contributor

@majin1102 majin1102 commented Mar 31, 2026

What Changed

  • Changed branch and tag metadata to structured key/value maps.
  • Added tag timestamp fields:
    • createdAt / created_at
    • updatedAt / updated_at
  • Exposed the new tag metadata shape consistently in Rust, Python, and Java.
  • Updated docs and tests to match the new ref metadata model.

Rust

  • TagContents now includes:
    • metadata: HashMap<String, String>
    • created_at: Option<DateTime<Utc>>
    • updated_at: Option<DateTime<Utc>>
  • Tag creation initializes timestamps.
  • Tag updates preserve created_at and refresh updated_at.
  • Ref serialization tests now cover:
    • map-based metadata
    • tag timestamps
    • backward compatibility for missing optional fields

Python

  • Python tag/branch metadata now uses dict-based metadata.
  • Tag listing APIs now return:
    • branch
    • version
    • created_at
    • updated_at
    • manifest_size
    • metadata
  • Updated the public Tag TypedDict.
  • Updated tests for tag metadata and timestamp behavior.
  • Fixed the Tags.list() docstring to describe the full returned metadata.

Java

  • Java Tag now includes:
    • Map<String, String> metadata
    • Optional<Instant> createdAt
    • Optional<Instant> updatedAt
  • JNI tag listing now passes timestamps and metadata maps into Java.
  • Updated Java tests to validate timestamp and metadata behavior.

Docs

  • Updated the branch/tag format spec to document tag timestamps and map-based metadata.
  • Updated the tags and branches guide examples to show the current tag metadata shape.

@github-actions github-actions bot added enhancement New feature or request python java labels Mar 31, 2026
@majin1102 majin1102 marked this pull request as draft March 31, 2026 15:23
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ca167a2b8f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@majin1102 majin1102 force-pushed the add_metadata_field branch from ca167a2 to cb7b97b Compare March 31, 2026 15:30
@majin1102 majin1102 marked this pull request as ready for review March 31, 2026 15:34
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cb7b97bda1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 57.40741% with 46 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rust/lance/src/dataset/refs.rs 57.40% 45 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@majin1102 majin1102 changed the title feat: add metadata field for branches and tags feat: add metadata and timestamp fields for branches and tags Apr 1, 2026
@majin1102 majin1102 force-pushed the add_metadata_field branch from 4bec46e to bcbeed3 Compare April 1, 2026 15:26
@majin1102 majin1102 changed the title feat: add metadata and timestamp fields for branches and tags feat: add branch/tag metadata maps and tag timestamps Apr 2, 2026
@majin1102 majin1102 force-pushed the add_metadata_field branch from bcbeed3 to a080281 Compare April 2, 2026 07:39
Copy link
Copy Markdown
Member

@westonpace westonpace left a comment

Choose a reason for hiding this comment

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

The change seems clean and straightforward. What is your motivation for branch / tag metadata? Arguably this might be a spec change (requiring 3 votes) though it isn't actually modifying any .proto files.

Comment on lines +122 to +123
| `createdAt` | string | Yes | RFC 3339 timestamp for when the tag was first created. |
| `updatedAt` | string | Yes | RFC 3339 timestamp for the latest tag reference update. |
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since we have manifest_size should this be created_at and updated_at for consistency?

Or actually, looking at the test, I wonder if this is supposed to be manifestSize below?

for (tag_name, tag_content) in tags {
let dict = PyDict::new(py);
dict.set_item("version", tag_content.version)?;
dict.set_item("created_at", tag_content.created_at)?;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you also need to set branch?

Comment on lines +5825 to +5827
"""
Replace metadata for an existing tag.
"""
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you expand on this a little? Will this merge in the metadata or completely replace any existing metadata? Will this cause updated_at to change?

@majin1102
Copy link
Copy Markdown
Contributor Author

majin1102 commented Apr 4, 2026

The change seems clean and straightforward. What is your motivation for branch / tag metadata? Arguably this might be a spec change (requiring 3 votes) though it isn't actually modifying any .proto files.

Thanks for driving this forward.

For reference, the motivation thread is here:
#6361

And the vote thread is here:
#6374
Would you mind voting there as well?

@majin1102 majin1102 force-pushed the add_metadata_field branch from 8999446 to 7ab286b Compare April 4, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request java python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants