Skip to content

feat: Make dynamo table tagging opt-in #5438

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

robhowley
Copy link
Contributor

@robhowley robhowley commented Jun 9, 2025

What this PR does / why we need it:

  • refactor table management to helper/service class
  • add dynamo config to include tag_aws_resources: bool = False
  • add retry mechanism to the table tagging for cases in which tagging calls are made too quickly
  • update tests

sample error one can get on apply

image

Which issue(s) this PR fixes:

Misc

Rob Howley added 2 commits June 9, 2025 12:14
Signed-off-by: Rob Howley <rhowley@seatgeek.com>
Signed-off-by: Rob Howley <rhowley@seatgeek.com>
@robhowley robhowley changed the title WIP: feat: make dynamo table tagging opt-in WIP: feat: Make dynamo table tagging opt-in Jun 9, 2025
Signed-off-by: Rob Howley <rhowley@seatgeek.com>
@robhowley robhowley changed the title WIP: feat: Make dynamo table tagging opt-in feat: Make dynamo table tagging opt-in Jun 9, 2025
pass


class _DynamoTableManager:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the online store class has become a cluttered god class, move the dynamo table creation/destruction to a helper class

Comment on lines +835 to +840
@retry(
wait=wait_exponential(multiplier=1, max=4),
retry=retry_if_exception_type(RetryableBotoError),
stop=stop_after_attempt(3),
reraise=True,
)
Copy link
Contributor Author

@robhowley robhowley Jun 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tagging a lot of dynamo tables can lead to api rate limiting errors, retry with backoff

@robhowley robhowley marked this pull request as ready for review June 9, 2025 17:42
@robhowley robhowley requested a review from a team as a code owner June 9, 2025 17:42
Comment on lines +85 to +86
tag_aws_resources: StrictBool = False
"""Add the feature-view tags to the underlying AWS dynamodb tables"""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feature isnt strictly necessary (though a good idea!) and results in a a few extra aws api calls per feature view, so make it opt in.

Copy link
Contributor

@jyejare jyejare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good , some comments!


class _DynamoTableManager:
def __init__(
self, dynamodb_resource, config: RepoConfig, feature_view: FeatureView
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self, dynamodb_resource, config: RepoConfig, feature_view: FeatureView
self, dynamodb_resource, config: RepoConfig, table: FeatureView

I would rather keep the parameter name in the context of Database that is table but accept FeatureView object as is suggests.

self, dynamodb_resource, config: RepoConfig, feature_view: FeatureView
):
self.config = config
self.feature_view = feature_view
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.feature_view = feature_view
self.feature_view = table

AttributeDefinitions=[
{"AttributeName": "entity_id", "AttributeType": "S"}
],
BillingMode="PAY_PER_REQUEST",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think billing mode should be taken for parameters and not hardcoded ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • @robhowley can you set this as something configurable with the default being PAY_PER_REQUEST?

BillingMode="PAY_PER_REQUEST",
**kwargs,
)
do_tag_update = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we setting it to False ? Good to annotate ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants