apache / apache/gravitino

[Improvement] Inconsistencies Between Python and Java APIs

Open
#6,598 5 comments 0 reactions 1 assignee Claimed by @AndreVale69 View on GitHub
improvement
Dominant language
Java
Stars
3.2k
Forks
935
Avg merge
1d 16h
Merged PRs (30d)
298

Description

### What would you like to be improved?

While working on issue #6577, I noticed (thanks to @yuqi1129, PR #6581) that there are some inconsistencies between APIs written on Python and Java. I think that this inconsistency can lead to confusion and errors.

I would like to suggest to adjust the signature functions written on Python. Here is an approximate list of incosisntecy that I found:
- On the gravitino client you can see the `create_catalog` method:
https://github.com/apache/gravitino/blob/873c6afeb3b0a5ebdb6d64b1d279442ac5e3115c/clients/client-python/gravitino/client/gravitino_client.py#L77-L87
https://github.com/apache/gravitino/blob/873c6afeb3b0a5ebdb6d64b1d279442ac5e3115c/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClient.java#L118-L127
Or the same with `load_catalog`:
https://github.com/apache/gravitino/blob/873c6afeb3b0a5ebdb6d64b1d279442ac5e3115c/clients/client-python/gravitino/client/gravitino_client.py#L74-L75
https://github.com/apache/gravitino/blob/873c6afeb3b0a5ebdb6d64b1d279442ac5e3115c/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClient.java#L113-L116
- On metalake you can see the same problem:
https://github.com/apache/gravitino/blob/873c6afeb3b0a5ebdb6d64b1d279442ac5e3115c/clients/client-python/gravitino/client/gravitino_metalake.py#L118-L125
https://github.com/apache/gravitino/blob/873c6afeb3b0a5ebdb6d64b1d279442ac5e3115c/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoMetalake.java#L215-L222

I'm a new contributor to this repository (I only made a one-line commit), so if you have any suggestions, I'm ready to hear them!

### How should we improve?

I suggest adapting the function signatures in the Python client to match those in the Java client. I think this will improve consistency and reduce potential bugs (for example, issue #6577 is born out of this inconsistency).

I would like to take up this issue and work on resolving it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.