Skip to content

Commit fbc6a2c

Browse files
authored
feat: Add ability to give boto extra args for registry config (#3219)
* feature: add ability to give boto extra args in config Signed-off-by: Max Z <[email protected]> * rename: s3_additional_kwargs Signed-off-by: Max Z <[email protected]> Signed-off-by: Max Z <[email protected]>
1 parent f020630 commit fbc6a2c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

sdk/python/feast/infra/registry/s3.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def __init__(self, registry_config: RegistryConfig, repo_path: Path):
2525
self._uri = urlparse(uri)
2626
self._bucket = self._uri.hostname
2727
self._key = self._uri.path.lstrip("/")
28+
self._boto_extra_args = registry_config.s3_additional_kwargs or {}
2829

2930
self.s3_client = boto3.resource(
3031
"s3", endpoint_url=os.environ.get("FEAST_S3_ENDPOINT_URL")
@@ -77,4 +78,6 @@ def _write_registry(self, registry_proto: RegistryProto):
7778
file_obj = TemporaryFile()
7879
file_obj.write(registry_proto.SerializeToString())
7980
file_obj.seek(0)
80-
self.s3_client.Bucket(self._bucket).put_object(Body=file_obj, Key=self._key)
81+
self.s3_client.Bucket(self._bucket).put_object(
82+
Body=file_obj, Key=self._key, **self._boto_extra_args
83+
)

sdk/python/feast/repo_config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ class RegistryConfig(FeastBaseModel):
113113
set to infinity by setting TTL to 0 seconds, which means the cache will only be loaded once and will never
114114
expire. Users can manually refresh the cache by calling feature_store.refresh_registry() """
115115

116+
s3_additional_kwargs: Optional[Dict[str, str]]
117+
""" Dict[str, str]: Extra arguments to pass to boto3 when writing the registry file to S3. """
118+
116119

117120
class RepoConfig(FeastBaseModel):
118121
"""Repo config. Typically loaded from `feature_store.yaml`"""

0 commit comments

Comments
 (0)