Skip to content

Commit 9607974

Browse files
feat(ds): add ashby as unreleased source (#42447)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent b2c44a3 commit 9607974

File tree

11 files changed

+115
-1
lines changed

11 files changed

+115
-1
lines changed

frontend/public/services/ashby.png

5.97 KB
Loading

frontend/src/queries/schema.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14203,6 +14203,7 @@
1420314203
},
1420414204
"ExternalDataSourceType": {
1420514205
"enum": [
14206+
"Ashby",
1420614207
"Supabase",
1420714208
"CustomerIO",
1420814209
"Github",

frontend/src/queries/schema/schema-general.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4498,6 +4498,7 @@ export interface SourceConfig {
44984498
}
44994499

45004500
export const externalDataSources = [
4501+
'Ashby',
45014502
'Supabase',
45024503
'CustomerIO',
45034504
'Github',

posthog/schema.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,6 +1444,7 @@ class ExperimentVariantTrendsBaseStats(BaseModel):
14441444

14451445

14461446
class ExternalDataSourceType(StrEnum):
1447+
ASHBY = "Ashby"
14471448
SUPABASE = "Supabase"
14481449
CUSTOMER_IO = "CustomerIO"
14491450
GITHUB = "Github"

posthog/temporal/data_imports/sources/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from .ashby.source import AshbySource
12
from .bigquery.source import BigQuerySource
23
from .bing_ads.source import BingAdsSource
34
from .braze.source import BrazeSource
@@ -33,6 +34,7 @@
3334
from .zendesk.source import ZendeskSource
3435

3536
__all__ = [
37+
"AshbySource",
3638
"SupabaseSource",
3739
"CustomerIOSource",
3840
"GithubSource",
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
from typing import cast
2+
3+
from posthog.schema import (
4+
ExternalDataSourceType as SchemaExternalDataSourceType,
5+
SourceConfig,
6+
)
7+
8+
from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponse
9+
from posthog.temporal.data_imports.sources.common.base import FieldType, SimpleSource
10+
from posthog.temporal.data_imports.sources.common.registry import SourceRegistry
11+
from posthog.temporal.data_imports.sources.common.schema import SourceSchema
12+
from posthog.temporal.data_imports.sources.generated_configs import AshbySourceConfig
13+
14+
from products.data_warehouse.backend.types import ExternalDataSourceType
15+
16+
# TODO(Andrew J. McGehee): implement the source logic for AshbySource
17+
18+
19+
@SourceRegistry.register
20+
class AshbySource(SimpleSource[AshbySourceConfig]):
21+
@property
22+
def source_type(self) -> ExternalDataSourceType:
23+
return ExternalDataSourceType.ASHBY
24+
25+
@property
26+
def get_source_config(self) -> SourceConfig:
27+
return SourceConfig(
28+
name=SchemaExternalDataSourceType.ASHBY,
29+
iconPath="/static/services/ashby.png",
30+
label="Ashby", # only needed if the readable name is complex. delete otherwise
31+
caption=None, # only needed if you want to inline docs
32+
docsUrl=None, # TODO(Andrew J. McGehee): link to the docs in the website, full path including https://
33+
fields=cast(list[FieldType], []), # TODO(Andrew J. McGehee): add source config fields here
34+
unreleasedSource=True,
35+
)
36+
37+
def validate_credentials(self, config: AshbySourceConfig, team_id: int) -> tuple[bool, str | None]:
38+
# TODO(Andrew J. McGehee): implement the logic to validate the credentials of your source,
39+
# e.g. check the validity of API keys. returns a tuple of whether the credentials are valid,
40+
# and if not, returns an error message to return to the user
41+
raise NotImplementedError()
42+
43+
def get_schemas(self, config: AshbySourceConfig, team_id: int, with_counts: bool = False) -> list[SourceSchema]:
44+
raise NotImplementedError()
45+
46+
def source_for_pipeline(self, config: AshbySourceConfig, inputs: SourceInputs) -> SourceResponse:
47+
raise NotImplementedError()

posthog/temporal/data_imports/sources/common/test/__snapshots__/test_source_config_generator.ambr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
def get_config_for_source(source: ExternalDataSourceType):
4545
return {
46+
ExternalDataSourceType.ASHBY: AshbySourceConfig,
4647
ExternalDataSourceType.BIGQUERY: BigQuerySourceConfig,
4748
ExternalDataSourceType.BINGADS: BingAdsSourceConfig,
4849
ExternalDataSourceType.BRAZE: BrazeSourceConfig,

posthog/temporal/data_imports/sources/generated_configs.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ class VitallyRegionConfig(config.Config):
5757
selection: Literal["EU", "US"] = "EU"
5858

5959

60+
@config.config
61+
class AshbySourceConfig(config.Config):
62+
pass
63+
64+
6065
@config.config
6166
class BigQuerySourceConfig(config.Config):
6267
key_file: BigQueryKeyFileConfig
@@ -276,6 +281,7 @@ class ZendeskSourceConfig(config.Config):
276281

277282
def get_config_for_source(source: ExternalDataSourceType):
278283
return {
284+
ExternalDataSourceType.ASHBY: AshbySourceConfig,
279285
ExternalDataSourceType.BIGQUERY: BigQuerySourceConfig,
280286
ExternalDataSourceType.BINGADS: BingAdsSourceConfig,
281287
ExternalDataSourceType.BRAZE: BrazeSourceConfig,
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Generated by create_datastack_source command on 2025-12-01 23:07
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("data_warehouse", "0010_alter_externaldatasource_source_type"),
9+
]
10+
11+
operations = [
12+
migrations.AlterField(
13+
model_name="externaldatasource",
14+
name="source_type",
15+
field=models.CharField(
16+
choices=[
17+
("Ashby", "Ashby"),
18+
("Supabase", "Supabase"),
19+
("CustomerIO", "CustomerIO"),
20+
("Github", "Github"),
21+
("Stripe", "Stripe"),
22+
("Hubspot", "Hubspot"),
23+
("Postgres", "Postgres"),
24+
("Zendesk", "Zendesk"),
25+
("Snowflake", "Snowflake"),
26+
("Salesforce", "Salesforce"),
27+
("MySQL", "MySQL"),
28+
("MongoDB", "MongoDB"),
29+
("MSSQL", "MSSQL"),
30+
("Vitally", "Vitally"),
31+
("BigQuery", "BigQuery"),
32+
("Chargebee", "Chargebee"),
33+
("GoogleAds", "GoogleAds"),
34+
("TemporalIO", "TemporalIO"),
35+
("DoIt", "DoIt"),
36+
("GoogleSheets", "GoogleSheets"),
37+
("MetaAds", "MetaAds"),
38+
("Klaviyo", "Klaviyo"),
39+
("Mailchimp", "Mailchimp"),
40+
("Braze", "Braze"),
41+
("Mailjet", "Mailjet"),
42+
("Redshift", "Redshift"),
43+
("Polar", "Polar"),
44+
("RevenueCat", "RevenueCat"),
45+
("LinkedinAds", "LinkedinAds"),
46+
("RedditAds", "RedditAds"),
47+
("TikTokAds", "TikTokAds"),
48+
("BingAds", "BingAds"),
49+
("Shopify", "Shopify"),
50+
],
51+
max_length=128,
52+
),
53+
),
54+
]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0010_alter_externaldatasource_source_type
1+
0011_alter_externaldatasource_source_type

0 commit comments

Comments
 (0)