-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(data-warehouse): external data job rewrite (#21494)
* WIP * Reworked the worker to self-manage making schema schedules and use async temporal calls * Added schema status and use it for the job status * Fixed existing tests * Added new tests to cover check_schedule_activity * Updated the source API to trigger active schemas * Added master changes for stripe source * Updated mypy * add blank to field * update migrations * update mypy * fix tpyes * Update query snapshots * Update query snapshots * fix types * update mypy * type ignore * add comment * add default args, fix missing schema sync creation, add deletion logic * remove defaults * add blank * cleanup * add failsafe * update reload logic * create new schemas if triggered between reloads * add schema off check --------- Co-authored-by: eric <[email protected]> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
fff6720
commit b2773cb
Showing
23 changed files
with
786 additions
and
508 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 4.1.13 on 2024-04-15 14:32 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("posthog", "0401_experiment_exposure_cohort"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="externaldatajob", | ||
name="schema", | ||
field=models.ForeignKey( | ||
blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to="posthog.externaldataschema" | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="externaldataschema", | ||
name="status", | ||
field=models.CharField(max_length=400, null=True, blank=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
from posthog.temporal.data_imports.external_data_job import ( | ||
ExternalDataJobWorkflow, | ||
create_external_data_job_model, | ||
create_external_data_job_model_activity, | ||
create_source_templates, | ||
run_external_data_job, | ||
import_data_activity, | ||
update_external_data_job_model, | ||
validate_schema_activity, | ||
check_schedule_activity, | ||
) | ||
|
||
WORKFLOWS = [ExternalDataJobWorkflow] | ||
|
||
ACTIVITIES = [ | ||
create_external_data_job_model, | ||
create_external_data_job_model_activity, | ||
update_external_data_job_model, | ||
run_external_data_job, | ||
import_data_activity, | ||
validate_schema_activity, | ||
create_source_templates, | ||
check_schedule_activity, | ||
] |
Oops, something went wrong.