Skip to content

Commit d42e5f2

Browse files
committed
hopefully fix tests
1 parent d833c5c commit d42e5f2

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

snuba/migrations/migration.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,13 @@ class SquashedMigration(Migration):
6161

6262
def forwards(self, context: Context, dry_run: bool) -> None:
6363
_migration_id, _logger, update_status = context
64-
update_status(Status.COMPLETED)
64+
if not dry_run:
65+
update_status(Status.COMPLETED)
6566

6667
def backwards(self, context: Context, dry_run: bool) -> None:
6768
_migration_id, _logger, update_status = context
68-
update_status(Status.NOT_STARTED)
69+
if not dry_run:
70+
update_status(Status.NOT_STARTED)
6971

7072

7173
class CodeMigration(Migration, ABC):

snuba/snuba_migrations/events_analytics_platform/0038_eap_items_add_sampling_factor.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ def forwards_ops(self) -> Sequence[operations.SqlOperation]:
4040
]
4141

4242
for sampling_weight in self.sampling_weights:
43-
downsampled_local_table_name = (
44-
f"eap_items_1_downsample_{sampling_weight}_local"
45-
)
43+
downsampled_local_table_name = f"eap_items_1_downsample_{sampling_weight}_local"
4644
ops.append(
4745
operations.AddColumn(
4846
storage_set=storage_set_name,
@@ -75,9 +73,7 @@ def backwards_ops(self) -> Sequence[operations.SqlOperation]:
7573
]
7674

7775
for sampling_weight in self.sampling_weights:
78-
downsampled_local_table_name = (
79-
f"eap_items_1_downsample_{sampling_weight}_local"
80-
)
76+
downsampled_local_table_name = f"eap_items_1_downsample_{sampling_weight}_local"
8177
ops.append(
8278
operations.DropColumn(
8379
storage_set=storage_set_name,

snuba/snuba_migrations/events_analytics_platform/0049_use_client_and_server_sample_rates_in_materialized_views.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,18 +151,8 @@ def backwards_ops(self) -> Sequence[SqlOperation]:
151151
ops: List[SqlOperation] = []
152152

153153
for sampling_weight in sampling_weights:
154-
local_table_name = f"eap_items_1_downsample_{sampling_weight}_local"
155-
156154
ops.extend(
157155
[
158-
operations.CreateMaterializedView(
159-
storage_set=storage_set_key,
160-
view_name=f"eap_items_1_downsample_{sampling_weight}_mv_{old_version}",
161-
columns=columns,
162-
destination_table_name=local_table_name,
163-
target=OperationTarget.LOCAL,
164-
query=generate_old_materialized_view_expression(sampling_weight),
165-
),
166156
operations.DropTable(
167157
storage_set=storage_set_key,
168158
table_name=f"eap_items_1_downsample_{sampling_weight}_mv_{new_version}",

0 commit comments

Comments
 (0)