|
79 | 79 | from pyiceberg.typedef import EMPTY_DICT, UTF8, IcebergBaseModel, Identifier, Properties |
80 | 80 | from pyiceberg.types import transform_dict_value_to_str |
81 | 81 | from pyiceberg.utils.deprecated import deprecation_message |
82 | | -from pyiceberg.utils.properties import get_first_property_value, property_as_bool |
| 82 | +from pyiceberg.utils.properties import get_first_property_value, get_header_properties, property_as_bool |
83 | 83 |
|
84 | 84 | if TYPE_CHECKING: |
85 | 85 | import pyarrow as pa |
@@ -139,7 +139,6 @@ class IdentifierKind(Enum): |
139 | 139 | SIGV4_SERVICE = "rest.signing-name" |
140 | 140 | AUTH_URL = "rest.authorization-url" |
141 | 141 | OAUTH2_SERVER_URI = "oauth2-server-uri" |
142 | | -HEADER_PREFIX = "header." |
143 | 142 |
|
144 | 143 | NAMESPACE_SEPARATOR = b"\x1f".decode(UTF8) |
145 | 144 |
|
@@ -554,16 +553,13 @@ def _refresh_token(self, session: Optional[Session] = None, initial_token: Optio |
554 | 553 | session.headers[AUTHORIZATION_HEADER] = f"{BEARER_PREFIX} {token}" |
555 | 554 |
|
556 | 555 | def _config_headers(self, session: Session) -> None: |
557 | | - header_properties = self._extract_headers_from_properties() |
| 556 | + header_properties = get_header_properties(self.properties) |
558 | 557 | session.headers.update(header_properties) |
559 | 558 | session.headers["Content-type"] = "application/json" |
560 | 559 | session.headers["X-Client-Version"] = ICEBERG_REST_SPEC_VERSION |
561 | 560 | session.headers["User-Agent"] = f"PyIceberg/{__version__}" |
562 | 561 | session.headers.setdefault("X-Iceberg-Access-Delegation", ACCESS_DELEGATION_DEFAULT) |
563 | 562 |
|
564 | | - def _extract_headers_from_properties(self) -> Dict[str, str]: |
565 | | - return {key[len(HEADER_PREFIX) :]: value for key, value in self.properties.items() if key.startswith(HEADER_PREFIX)} |
566 | | - |
567 | 563 | def _create_table( |
568 | 564 | self, |
569 | 565 | identifier: Union[str, Identifier], |
|
0 commit comments