Skip to content

Commit

Permalink
fix(data-warehouse): test prefetch (#23162)
Browse files Browse the repository at this point in the history
make sure job prefetches
  • Loading branch information
EDsCODE authored Jun 21, 2024
1 parent 186711f commit e0bc92b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions posthog/temporal/tests/external_data/test_external_data_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,9 @@ async def setup_job_1():
schema=customer_schema,
)

new_job = await sync_to_async(ExternalDataJob.objects.filter(id=new_job.id).prefetch_related("pipeline").get)()
new_job = await sync_to_async(
ExternalDataJob.objects.filter(id=new_job.id).prefetch_related("pipeline").prefetch_related("schema").get
)()

inputs = ImportDataActivityInputs(
team_id=team.id,
Expand Down Expand Up @@ -438,7 +440,9 @@ async def setup_job_1():
schema=customer_schema,
)

new_job = await sync_to_async(ExternalDataJob.objects.filter(id=new_job.id).prefetch_related("pipeline").get)()
new_job = await sync_to_async(
ExternalDataJob.objects.filter(id=new_job.id).prefetch_related("pipeline").prefetch_related("schema").get
)()

inputs = ImportDataActivityInputs(
team_id=team.id,
Expand Down Expand Up @@ -522,7 +526,9 @@ async def setup_job_1():
schema=customer_schema,
)

new_job = await sync_to_async(ExternalDataJob.objects.filter(id=new_job.id).prefetch_related("pipeline").get)()
new_job = await sync_to_async(
ExternalDataJob.objects.filter(id=new_job.id).prefetch_related("pipeline").prefetch_related("schema").get
)()

inputs = ImportDataActivityInputs(
team_id=team.id,
Expand Down Expand Up @@ -688,7 +694,9 @@ async def setup_job_1():
schema=posthog_test_schema,
)

new_job = await sync_to_async(ExternalDataJob.objects.filter(id=new_job.id).prefetch_related("pipeline").get)()
new_job = await sync_to_async(
ExternalDataJob.objects.filter(id=new_job.id).prefetch_related("pipeline").prefetch_related("schema").get
)()

inputs = ImportDataActivityInputs(
team_id=team.id, run_id=str(new_job.pk), source_id=new_source.pk, schema_id=posthog_test_schema.id
Expand Down

0 comments on commit e0bc92b

Please sign in to comment.