Skip to content

Commit

Permalink
Python: Set the Iceberg Spec version (apache#5766)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Fokko authored Sep 19, 2022
1 parent 1d3cdcc commit 4f45eb3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/pyiceberg/catalog/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
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"
Expand Down Expand Up @@ -195,7 +197,8 @@ def _check_valid_namespace_identifier(self, identifier: Union[str, Identifier])
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}"
Expand Down

0 comments on commit 4f45eb3

Please sign in to comment.