You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by fo...@apache.org on 2022/09/19 06:37:26 UTC
[iceberg] branch master updated: Python: Set the Iceberg Spec version (#5766)
This is an automated email from the ASF dual-hosted git repository.
fokko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iceberg.git
The following commit(s) were added to refs/heads/master by this push:
new 4f45eb3ae7 Python: Set the Iceberg Spec version (#5766)
4f45eb3ae7 is described below
commit 4f45eb3ae778a0204ae9c9ab402fcf92e758a7d2
Author: Fokko Driesprong <fo...@apache.org>
AuthorDate: Mon Sep 19 08:37:20 2022 +0200
Python: Set the Iceberg Spec version (#5766)
We pass in the version of the response that we expect for a certain
version. If we change anything in the future in the spec, we can
maintain backward compatibility until the version is being bumped.
---
python/pyiceberg/catalog/rest.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/python/pyiceberg/catalog/rest.py b/python/pyiceberg/catalog/rest.py
index 4931e5671b..23d0ccf942 100644
--- a/python/pyiceberg/catalog/rest.py
+++ b/python/pyiceberg/catalog/rest.py
@@ -58,6 +58,8 @@ from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder
from pyiceberg.typedef import EMPTY_DICT
from pyiceberg.utils.iceberg_base_model import IcebergBaseModel
+ICEBERG_REST_SPEC_VERSION = "0.14.1"
+
class Endpoints:
get_config: str = "config"
@@ -195,7 +197,8 @@ class RestCatalog(Catalog):
def headers(self) -> Properties:
headers = {
"Content-type": "application/json",
- "X-Client-Version": __version__,
+ "X-Client-Version": ICEBERG_REST_SPEC_VERSION,
+ "User-Agent": f"PyIceberg/{__version__}",
}
if token := self.properties.get("token"):
headers[AUTHORIZATION_HEADER] = f"{BEARER_PREFIX} {token}"