File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -491,6 +491,7 @@ def _config_headers(self, session: Session) -> None:
491491 session .headers .update (header_properties )
492492 session .headers ["Content-type" ] = "application/json"
493493 session .headers ["User-Agent" ] = f"PyIceberg/{ __version__ } "
494+ session .headers ["X-Client-Version" ] = f"Apache PyIceberg { __version__ } "
494495 session .headers .setdefault ("X-Iceberg-Access-Delegation" , ACCESS_DELEGATION_DEFAULT )
495496
496497 def _create_table (
Original file line number Diff line number Diff line change @@ -1922,6 +1922,12 @@ def test_auth_header(rest_mock: Mocker) -> None:
19221922 assert mock_request .last_request .text == "grant_type=client_credentials&client_id=client&client_secret=secret&scope=catalog"
19231923
19241924
1925+ def test_client_version_header (rest_mock : Mocker ) -> None :
1926+ catalog = RestCatalog ("rest" , uri = TEST_URI , warehouse = "s3://some-bucket" )
1927+ assert catalog ._session .headers .get ("X-Client-Version" ) == f"Apache PyIceberg { pyiceberg .__version__ } "
1928+ assert rest_mock .last_request .headers ["X-Client-Version" ] == f"Apache PyIceberg { pyiceberg .__version__ } "
1929+
1930+
19251931class TestRestCatalogClose :
19261932 """Tests RestCatalog close functionality"""
19271933
You can’t perform that action at this time.
0 commit comments