Skip to content

[python] Improve the consumer_manager API and support in file_store_table#7415

Merged
JingsongLi merged 8 commits intoapache:masterfrom
xuzifu666:py_consumer_manager_detail
Mar 12, 2026
Merged

[python] Improve the consumer_manager API and support in file_store_table#7415
JingsongLi merged 8 commits intoapache:masterfrom
xuzifu666:py_consumer_manager_detail

Conversation

@xuzifu666
Copy link
Member

@xuzifu666 xuzifu666 commented Mar 12, 2026

Purpose

Follow up #7349, make it more consistent with the Java-side implementation.

  1. Add more comprehensive ConsumerManager APIs, supporting branch switching and related testing;
  2. Supplement the consumer_manager documents in python-api.md.

Tests

API and Format

Documentation

Generative AI tooling

@xuzifu666 xuzifu666 changed the title [python] Improve the consumer_manager API and add it to the file_store_table [python] Improve the consumer_manager API and support in file_store_table Mar 12, 2026
file_io = table.file_io()

# Create consumer manager
manager = ConsumerManager(file_io, table.location())
Copy link
Contributor

Choose a reason for hiding this comment

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

ConsumerManager should be obtained from table?

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense, it has been changed.

manager_main = ConsumerManager(file_io, table.location())

# Custom branch
manager_branch = ConsumerManager(file_io, table.location(), branch='feature_branch')
Copy link
Contributor

Choose a reason for hiding this comment

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

branch_manager = manager.with_branch('xxx')

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

self.total_buckets = self.options.bucket()

self.schema_manager = SchemaManager(file_io, table_path)
self.consumer_manager = ConsumerManager(file_io, table_path, self.current_branch())
Copy link
Contributor

Choose a reason for hiding this comment

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

just provide a method consumer_manager(), and import ConsumerManager in it.


```python
from pypaimon import CatalogFactory
from pypaimon.consumer.consumer_manager import ConsumerManager
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to import?

file_io = table.file_io()

# Create consumer manager
manager = table.consumer_manager
Copy link
Contributor

Choose a reason for hiding this comment

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

table.consumer_manager()

@JingsongLi
Copy link
Contributor

+1

@JingsongLi JingsongLi merged commit 0d3cab4 into apache:master Mar 12, 2026
6 checks passed
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.

2 participants