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

fix AssertionError in snuba 0006_sorting_key_change migration #6203

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions snuba/snuba_migrations/querylog/0006_sorting_key_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ def update_querylog_table(clickhouse: ClickhousePool, database: str) -> None:
# Update the timestamp column
# Clickhouse 20 does not support altering a column in the primary key so we need to do it here
new_timestamp_type = "`timestamp` DateTime CODEC(T64, ZSTD(1))"
assert new_create_table_statement.count(new_timestamp_type) == 0
assert new_create_table_statement.count("`timestamp` DateTime") == 1
new_create_table_statement = new_create_table_statement.replace(
"`timestamp` DateTime", new_timestamp_type
)
if new_create_table_statement.count(new_timestamp_type) == 0:
assert new_create_table_statement.count("`timestamp` DateTime") == 1
new_create_table_statement = new_create_table_statement.replace(
"`timestamp` DateTime", new_timestamp_type
)
assert new_timestamp_type in new_create_table_statement

# Create the new table
Expand Down
Loading