Skip to content

[Enhancement] Simplify Import Paths by truncating py4j #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chenghuichen opened this issue Feb 23, 2025 · 0 comments · Fixed by #43
Closed

[Enhancement] Simplify Import Paths by truncating py4j #42

chenghuichen opened this issue Feb 23, 2025 · 0 comments · Fixed by #43

Comments

@chenghuichen
Copy link
Contributor

chenghuichen commented Feb 23, 2025

Currently, users need to import core classes like Catalog and Table from the implementation-specific module py4j:

from pypaimon.py4j import Catalog
from pypaimon.py4j import Table

This exposes internal technical details and creates unnecessary coupling between user code and the implementation mechanism.

I propose to expose these core classes at the package root level by re-exporting them in init.py, allowing users to import directly from the main package:

from pypaimon import Catalog
from pypaimon import Table

Benefits:

  • Cleaner and more intuitive API - users don't need to know about the underlying Py4J implementation
  • More flexibility for future refactoring - we can change the underlying implementation without breaking user code
  • Follows Python best practices of providing a clean public API

This change maintains backward compatibility while providing a better developer experience.

@chenghuichen chenghuichen changed the title [Enhancement] Simplify Import Paths by Exposing Core Classes at Package Root [Enhancement] Simplify Import Paths by truncating py4j Feb 23, 2025
chenghuichen added a commit to chenghuichen/paimon-python that referenced this issue Feb 23, 2025
chenghuichen added a commit to chenghuichen/paimon-python that referenced this issue Feb 23, 2025
chenghuichen added a commit to chenghuichen/paimon-python that referenced this issue Mar 20, 2025
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 a pull request may close this issue.

1 participant