New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
configure streams based on settings #9
Conversation
pydjamodb/connection.py
Outdated
@@ -71,6 +71,8 @@ def create_table(self, | |||
settings.PYDJAMODB_DATABASE.get('POINT_IN_TIME_RECOVERY', False) if set_point_in_time_recovery is None | |||
else set_point_in_time_recovery | |||
) | |||
if not stream_specification and settings.PYDJAMODB_DATABASE.get('STREAM_ENABLED'): | |||
stream_specification = {'stream_enabled': True, 'stream_view_type': 'NEW_AND_OLD_IMAGES'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need old images. Use NEW_IMAGE
only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, changed
9bff926
to
fe355bd
Compare
pydjamodb/connection.py
Outdated
@@ -71,6 +71,8 @@ def create_table(self, | |||
settings.PYDJAMODB_DATABASE.get('POINT_IN_TIME_RECOVERY', False) if set_point_in_time_recovery is None | |||
else set_point_in_time_recovery | |||
) | |||
if not stream_specification and settings.PYDJAMODB_DATABASE.get('STREAM_ENABLED'): | |||
stream_specification = {'stream_enabled': True, 'stream_view_type': 'NEW_IMAGE'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stream_view_type cannot be changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe better solution should be set whole stream specification in PYDJAMODB_DATABASE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PYDJAMODB_DATABASE = {
...
STREAM_SPECIFICATION: {'stream_enabled': True, 'stream_view_type': 'NEW_IMAGE'}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea, changed.
fe355bd
to
9e85c7c
Compare
pydjamodb/connection.py
Outdated
@@ -71,6 +71,10 @@ def create_table(self, | |||
settings.PYDJAMODB_DATABASE.get('POINT_IN_TIME_RECOVERY', False) if set_point_in_time_recovery is None | |||
else set_point_in_time_recovery | |||
) | |||
stream_specification_settings = settings.PYDJAMODB_DATABASE.get('STREAM_SPECIFICATION') | |||
if (not stream_specification and stream_specification_settings | |||
and stream_specification_settings.get('stream_enabled')): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you specify image view type and streams are disabled you get error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but this is settings problem. Therefore it should be left up to developer..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I have changed that but it's little bit more complicated definition in PYDJAMODB_DATABASE settings from main app.
9e85c7c
to
b6b787e
Compare
b6b787e
to
bf616a2
Compare
Pull Request Test Coverage Report for Build 1682964702
💛 - Coveralls |
No description provided.