-
Notifications
You must be signed in to change notification settings - Fork 335
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
[#2230] feat(client-python): Add doc and support publishing Gravitino Python client to Pypi #2932
Conversation
I will improve this PR. |
Many thanks. |
bc039e3
to
11b01c1
Compare
hi @SophieTech88 I help you improvement this PR, |
docs/how-to-use-python-client.md
Outdated
5. Distribute the Gravitino Python client module | ||
|
||
```shell | ||
./gradlew :clients:client-python:distribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no distribute
task in build.gradle.kts
, only distribution
task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I fixed it.
docs/how-to-use-the-playground.md
Outdated
@@ -8,7 +8,7 @@ This software is licensed under the Apache License version 2." | |||
|
|||
## Playground introduction | |||
|
|||
The playground is a complete Gravitino Docker runtime environment with `Hive`, `HDFS`, `Trino`, `MySQL`, `PostgreSQL`, and a `Gravitino` server. | |||
The playground is a complete Gravitino Docker runtime environment with `Hive`, `HDFS`, `Trino`, `MySQL`, `PostgreSQL`, `Jupter`, and a `Gravitino` server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's Jupyter
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I fixed it.
Publish the first version of Gravitino Pyhton client to Pypi Ticket: 2230
docs/how-to-use-the-playground.md
Outdated
``` | ||
|
||
### Experiencing Gravitino Fileset with Jupyter | ||
We proved a Fileset playground environment to help you quickly understand how to use Gravitino Python client to manage HDFS in Gravitino service. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proved -> provided?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DONE
docs/how-to-use-the-playground.md
Outdated
3. Install Gravitino Python client | ||
4. Initialize Gravitino admin client and create a Gravitino metalake | ||
5. Initialize Gravitino client and list metalakes | ||
6. Create a Gravitino `Catalog` and special `type` is `Catalog.Type.FILESET` and `proved` is [hadoop](https://datastrato.ai/docs/latest/hadoop-catalog) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proved -> provider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DONE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me rewrite this doc.
@@ -200,15 +200,14 @@ def format_fileset_request_path(namespace: Namespace) -> str: | |||
def to_fileset_update_request(change: FilesetChange): | |||
if isinstance(change, FilesetChange.RenameFileset): | |||
return FilesetUpdateRequest.RenameFilesetRequest(change.new_name()) | |||
elif isinstance(change, FilesetChange.UpdateFilesetComment): | |||
if isinstance(change, FilesetChange.UpdateFilesetComment): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we change the elif
to if
? Does that mean we have to continue the remaining if
judgment even though the first if
is matched?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logically it is the same because of the return, right? Let me check if it is the code style of python.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, actually it's no-else-return
in Pylint, it's not necessary to use elif
in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is suggested by pylint, the no-else-return rule
https://pylint.pycqa.org/en/latest/user_guide/messages/refactor/no-else-return.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.
setup( | ||
name="gravitino", | ||
description="Python lib/client for Gravitino", | ||
version="0.5.0", | ||
long_description=open("README.md").read(), | ||
version="0.5.0.dev12", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we define this version 0.5.0.dev12
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here covers all versioning Python packages.
https://packaging.python.org/en/latest/discussions/versioning/
The version number need to be changed each commit Pypi.org.
packages=find_packages(include=["gravitino", ".*"]), | ||
packages=find_packages(exclude=["tests*"]), | ||
classifiers=[ | ||
'Development Status :: 3 - Alpha', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the meaning of 3 - Alpha
, does it have special purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is Pypi.org's development status classify, https://pypi.org/search/?c=Development+Status+%3A%3A+3+-+Alpha
docs/how-to-use-python-client.md
Outdated
First of all, You must have a Gravitino Service, You can refer document of [How to install Gravitino](https://datastrato.ai/docs/latest/how-to-install) | ||
to build Gravitino service from source code and install it in your local. | ||
|
||
### Gravitino Python client API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'd better add a chapter/paragraph here about how to install or use python client, like pip install
or something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@xunliu please review again, I did some changes in doc. |
The doc context very good! But If use relative path in the doc, We need convert url to absolute path,
So I add a commit to support convert url. @jerryshao Please help me review this PR, Thanks. |
Thanks @SophieTech88 @xunliu for your contributions. I'm going to merge this. |
… Python client to Pypi (#2932) ### What changes were proposed in this pull request? We published the first version of python-client package of Gravitino to Pypi. 1. Add how to use Python Client document 2. add some tools to requirements.txt 3. `./gradlew :clients:client-python:distribution` 4. `./gradlew :clients:client-python:deploy` ### Why are the changes needed? We need the python client package for user to use Gravitino in Python project. #2230 ### Does this PR introduce _any_ user-facing change? Users can use `pip install gravitino` to install the Gravitino python-client package directly. ### How was this patch tested? CI Passed --------- Co-authored-by: xunliu <xun@datastrato.com> Co-authored-by: Jerry Shao <jerryshao@datastrato.com>
…vitino Python client to Pypi (apache#2932) ### What changes were proposed in this pull request? We published the first version of python-client package of Gravitino to Pypi. 1. Add how to use Python Client document 2. add some tools to requirements.txt 3. `./gradlew :clients:client-python:distribution` 4. `./gradlew :clients:client-python:deploy` ### Why are the changes needed? We need the python client package for user to use Gravitino in Python project. apache#2230 ### Does this PR introduce _any_ user-facing change? Users can use `pip install gravitino` to install the Gravitino python-client package directly. ### How was this patch tested? CI Passed --------- Co-authored-by: xunliu <xun@datastrato.com> Co-authored-by: Jerry Shao <jerryshao@datastrato.com>
What changes were proposed in this pull request?
We published the first version of python-client package of Gravitino to Pypi.
./gradlew :clients:client-python:distribution
./gradlew :clients:client-python:deploy
Why are the changes needed?
We need the python client package for user to use Gravitino in Python project.
#2230
Does this PR introduce any user-facing change?
Users can use
pip install gravitino
to install the Gravitino python-client package directly.How was this patch tested?
CI Passed