Skip to content
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

Re-query ShopperTrak for missing sites #9

Merged
merged 3 commits into from
Dec 23, 2024
Merged

Conversation

aaronfriedman6
Copy link
Contributor

This code checks for sites that did not appear in the ShopperTrak response for a given day, which is distinct from what we currently do (check for sites that appeared in the API response but had unhealthy data)

create_table_query = build_redshift_create_table_query(
self.redshift_visits_table, start_date, end_date
)
self.redshift_client.connect()
found_site_dates = self.redshift_client.execute_query(found_sites_query)
self.redshift_client.execute_transaction([(create_table_query, None)])

Choose a reason for hiding this comment

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

Why is execute_transaction used vs execute_query?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Originally it was for executing a bunch of queries that depend on each other as part of the same transaction (e.g. don't delete rows in a table if the update to a different table fails). The naming is a bit of a relic though because now I mostly use it to do write queries (even outside of a transaction) whereas execute_query can only run read queries.

@aaronfriedman6 aaronfriedman6 merged commit 32aa39b into main Dec 23, 2024
2 checks passed
@aaronfriedman6 aaronfriedman6 deleted the check-missing-sites branch December 23, 2024 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants