Skip to content

Commit

Permalink
Merge pull request feast-dev#3 from leonid133/fix/registry_mkdirs
Browse files Browse the repository at this point in the history
Fix/registry mkdirs
  • Loading branch information
leonid133 authored Apr 21, 2021
2 parents ecf2c18 + 89326ec commit ab49bd0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
5 changes: 0 additions & 5 deletions sdk/python/feast/infra/aws_dynamo_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,9 @@


class AwsDynamoProvider(Provider):
_aws_project_id: Optional[str]

def __init__(self, config: RepoConfig):
assert isinstance(config.online_store, DynamoOnlineStoreConfig)
if config and config.online_store and config.online_store.project_id:
self._aws_project_id = config.online_store.project_id
else:
self._aws_project_id = None

def _initialize_dynamodb(self):
return boto3.resource('dynamodb')
Expand Down
11 changes: 7 additions & 4 deletions sdk/python/feast/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,10 +540,13 @@ def _write_registry(self, registry_proto: RegistryProto):
registry_proto.version_id = str(uuid.uuid4())
registry_proto.last_updated.FromDatetime(datetime.utcnow())
# we have already checked the bucket exists so no need to do it again
registry_bucket = boto3.resource('s3').Bucket(self._bucket)
registry_db = registry_bucket.Object(self._key)
file_obj = TemporaryFile()
file_obj.write(registry_proto.SerializeToString())
file_obj.seek(0)
registry_db.upload_fileobj(file_obj)
return
s3 = boto3.client('s3')
s3.put_object(
Bucket=self._bucket,
Body=file_obj,
Key=self._key
)
return
1 change: 0 additions & 1 deletion sdk/python/feast/repo_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class DynamoOnlineStoreConfig(FeastBaseModel):
"""Online store config for DynamoDB store"""
type: Literal["dynamo"] = "dynamo"
"""Online store type selector"""
project_id: Optional[StrictStr] = None


OnlineStoreConfig = Union[DatastoreOnlineStoreConfig, SqliteOnlineStoreConfig, DynamoOnlineStoreConfig]
Expand Down

0 comments on commit ab49bd0

Please sign in to comment.