Fix flake8 failures (boo)
This commit is contained in:
parent
e7b01292e9
commit
46c0f8915f
@ -406,8 +406,7 @@ class Table(BaseModel):
|
|||||||
|
|
||||||
def set_stream_specification(self, streams):
|
def set_stream_specification(self, streams):
|
||||||
self.stream_specification = streams
|
self.stream_specification = streams
|
||||||
if streams and (streams.get('StreamEnabled')
|
if streams and (streams.get('StreamEnabled') or streams.get('StreamViewType')):
|
||||||
or streams.get('StreamViewType')):
|
|
||||||
self.stream_specification['StreamEnabled'] = True
|
self.stream_specification['StreamEnabled'] = True
|
||||||
self.latest_stream_label = datetime.datetime.utcnow().isoformat()
|
self.latest_stream_label = datetime.datetime.utcnow().isoformat()
|
||||||
self.stream_shard = StreamShard(self)
|
self.stream_shard = StreamShard(self)
|
||||||
@ -782,9 +781,7 @@ class DynamoDBBackend(BaseBackend):
|
|||||||
|
|
||||||
def update_table_streams(self, name, stream_specification):
|
def update_table_streams(self, name, stream_specification):
|
||||||
table = self.tables[name]
|
table = self.tables[name]
|
||||||
if ((stream_specification.get('StreamEnabled')
|
if (stream_specification.get('StreamEnabled') or stream_specification.get('StreamViewType')) and table.latest_stream_label:
|
||||||
or stream_specification.get('StreamViewType'))
|
|
||||||
and table.latest_stream_label):
|
|
||||||
raise ValueError('Table already has stream enabled')
|
raise ValueError('Table already has stream enabled')
|
||||||
table.set_stream_specification(stream_specification)
|
table.set_stream_specification(stream_specification)
|
||||||
return table
|
return table
|
||||||
|
Loading…
Reference in New Issue
Block a user