forked from apache/gravitino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'branch-0.6' into branch-0.6
- Loading branch information
Showing
20 changed files
with
317 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
|
||
**/.pytest_cache/** | ||
**/__pycache__/** | ||
gravitino.egg-info | ||
apache_gravitino.egg-info | ||
vevn | ||
venv | ||
.vevn | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
clients/client-python/gravitino/exceptions/handlers/catalog_error_handler.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
""" | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
""" | ||
|
||
from gravitino.constants.error import ErrorConstants | ||
from gravitino.dto.responses.error_response import ErrorResponse | ||
from gravitino.exceptions.handlers.rest_error_handler import RestErrorHandler | ||
from gravitino.exceptions.base import ( | ||
ConnectionFailedException, | ||
NoSuchMetalakeException, | ||
NoSuchCatalogException, | ||
CatalogAlreadyExistsException, | ||
) | ||
|
||
|
||
class CatalogErrorHandler(RestErrorHandler): | ||
|
||
def handle(self, error_response: ErrorResponse): | ||
|
||
error_message = error_response.format_error_message() | ||
code = error_response.code() | ||
exception_type = error_response.type() | ||
|
||
if code == ErrorConstants.CONNECTION_FAILED_CODE: | ||
raise ConnectionFailedException(error_message) | ||
if code == ErrorConstants.NOT_FOUND_CODE: | ||
if exception_type == NoSuchMetalakeException.__name__: | ||
raise NoSuchMetalakeException(error_message) | ||
if exception_type == NoSuchCatalogException.__name__: | ||
raise NoSuchCatalogException(error_message) | ||
if code == ErrorConstants.ALREADY_EXISTS_CODE: | ||
raise CatalogAlreadyExistsException(error_message) | ||
|
||
super().handle(error_response) | ||
|
||
|
||
CATALOG_ERROR_HANDLER = CatalogErrorHandler() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,23 +24,33 @@ | |
with open("README.md") as f: | ||
long_description = f.read() | ||
except FileNotFoundError: | ||
long_description = "Gravitino Python client" | ||
long_description = "Apache Gravitino Python client" | ||
|
||
setup( | ||
name="gravitino", | ||
description="Python lib/client for Gravitino", | ||
version="0.6.0.dev", | ||
name="apache-gravitino", | ||
description="Python lib/client for Apache Gravitino", | ||
version="0.6.0.dev0", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
url="https://github.com/apache/gravitino", | ||
author="gravitino", | ||
author="Apache Software Foundation", | ||
author_email="[email protected]", | ||
maintainer="Apache Gravitino Community", | ||
maintainer_email="[email protected]", | ||
license="Apache-2.0", | ||
url="https://github.com/apache/gravitino", | ||
python_requires=">=3.8", | ||
keywords="Data, AI, metadata, catalog", | ||
packages=find_packages(exclude=["tests*", "scripts*"]), | ||
project_urls={ | ||
"Homepage": "https://gravitino.apache.org/", | ||
"Source Code": "https://github.com/apache/gravitino", | ||
"Documentation": "https://gravitino.apache.org/docs/overview", | ||
"Bug Tracker": "https://github.com/apache/gravitino/issues", | ||
"Slack Chat": "https://the-asf.slack.com/archives/C078RESTT19", | ||
}, | ||
classifiers=[ | ||
"Development Status :: 3 - Alpha", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
|
Oops, something went wrong.