:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(warehouse-sources): add crunchbase jobs, category, location and ownership tables (#104382)
Tom Owers37ef3aa28fc5
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.mdindex dcfe08d12a5b..f7847f2e8600 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md@@ -2166,14 +2166,14 @@ Note: Notifications, API keys, and status pages were excluded as configuration.## Crunchbase — gaps-Today (7): `acquisitions`, `funding_rounds`, `funds`, `investments`, `ipos`, `organizations`, `people`+Today (12): `acquisitions`, `categories`, `category_groups`, `funding_rounds`, `funds`, `investments`, `ipos`, `jobs`, `locations`, `organizations`, `ownerships`, `people`Diffed against: <https://data.crunchbase.com/llms.txt>-- [ ] `jobs (POST /searches/jobs)` — person-to-organization employment membership table joining the two entities we already sync (high)-- [ ] `categories and category_groups (and microcategories)` — lookup tables resolving the category UUIDs on every organization record (high)-- [ ] `locations` — lookup resolving the location UUIDs on organizations, people, and funding rounds (high)-- [ ] `ownerships` — parent/subsidiary relationships between organizations; needed to roll spend or funding up a corporate tree (medium)+- [x] `jobs (POST /searches/jobs)` — person-to-organization employment membership table joining the two entities we already sync (high)+- [x] `categories and category_groups (and microcategories)` — lookup tables resolving the category UUIDs on every organization record (high). `micro_categories` is in the Predictions & Insights package, not the Firmographic package the source targets, so it was left out.+- [x] `locations` — lookup resolving the location UUIDs on organizations, people, and funding rounds (high)+- [x] `ownerships` — parent/subsidiary relationships between organizations; needed to roll spend or funding up a corporate tree (medium)- [ ] `key_employee_changes` — executive-change event stream, a standard signal for sales and investment triggers (medium)- [ ] `layoffs` — layoff event stream with dates and headcount, a headline distress signal (medium)- [ ] `press_references` — news mentions per organization, commonly used for momentum scoring (medium)diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/crunchbase/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/crunchbase/canonical_descriptions.pyindex 32a86534d5e1..9dce46391f3a 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/crunchbase/canonical_descriptions.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/crunchbase/canonical_descriptions.py@@ -97,4 +97,58 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {name="Name of the fund.",),},+ "jobs": {+ "description": "A role held by a person at an organization in Crunchbase, past or present.",+ "docs_url": "https://data.crunchbase.com/docs/crunchbase-basic-getting-started",+ "columns": _columns(+ person_identifier="The person who holds or held the job.",+ organization_identifier="The organization the job is at.",+ title="Job title the person holds or held.",+ job_type="Seniority category of the job (e.g. executive, board_member, advisor).",+ is_current="Whether the person still holds the job.",+ started_on="Date the person started the job.",+ ended_on="Date the person left the job.",+ short_description="Brief summary of the job.",+ ),+ },+ "categories": {+ "description": "An industry category that organizations are tagged with in Crunchbase.",+ "docs_url": "https://data.crunchbase.com/docs/crunchbase-basic-getting-started",+ "columns": _columns(+ name="Name of the category.",+ category_groups="Category groups the category rolls up into.",+ naics_code="North American Industry Classification System code for the category.",+ ),+ },+ "category_groups": {+ "description": "A broad industry grouping that Crunchbase categories roll up into.",+ "docs_url": "https://data.crunchbase.com/docs/crunchbase-basic-getting-started",+ "columns": _columns(+ name="Name of the category group.",+ categories="Categories that belong to the group.",+ ),+ },+ "locations": {+ "description": "A place in the Crunchbase location hierarchy, such as a city, region, or country.",+ "docs_url": "https://data.crunchbase.com/docs/crunchbase-basic-getting-started",+ "columns": _columns(+ name="Name of the location.",+ permalink="Crunchbase permalink of the location.",+ location_type="Level of the location in the hierarchy (e.g. city, region, country, continent).",+ country_code="Three-letter country code of the location.",+ region_code="Region code of the location.",+ locations="Parent locations that contain this location.",+ ),+ },+ "ownerships": {+ "description": "A parent/subsidiary relationship between two organizations in Crunchbase.",+ "docs_url": "https://data.crunchbase.com/docs/crunchbase-basic-getting-started",+ "columns": _columns(+ name="Name of the ownership relationship.",+ owner_identifier="The parent organization in the relationship.",+ ownee_identifier="The subsidiary organization in the relationship.",+ ownership_type="Nature of the relationship (e.g. subsidiary, affiliated_company, division).",+ rank="Crunchbase rank of the ownership relationship.",+ ),+ },}diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/crunchbase/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/crunchbase/settings.pyindex 4cd7f162a26b..eb28731d2c64 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/crunchbase/settings.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/crunchbase/settings.py@@ -89,6 +89,56 @@ CRUNCHBASE_ENDPOINTS: dict[str, CrunchbaseEndpointConfig] = {collection="funds",field_ids=[*_COMMON_FIELD_IDS, "announced_on", "money_raised", "name"],),+ "jobs": CrunchbaseEndpointConfig(+ name="jobs",+ collection="jobs",+ field_ids=[+ *_COMMON_FIELD_IDS,+ "person_identifier",+ "organization_identifier",+ "title",+ "job_type",+ "is_current",+ "started_on",+ "ended_on",+ "short_description",+ ],+ ),+ "categories": CrunchbaseEndpointConfig(+ name="categories",+ collection="categories",+ field_ids=[*_COMMON_FIELD_IDS, "name", "category_groups", "naics_code"],+ ),+ "category_groups": CrunchbaseEndpointConfig(+ name="category_groups",+ collection="category_groups",+ field_ids=[*_COMMON_FIELD_IDS, "name", "categories"],+ ),+ "locations": CrunchbaseEndpointConfig(+ name="locations",+ collection="locations",+ field_ids=[+ *_COMMON_FIELD_IDS,+ "name",+ "permalink",+ "location_type",+ "country_code",+ "region_code",+ "locations",+ ],+ ),+ "ownerships": CrunchbaseEndpointConfig(+ name="ownerships",+ collection="ownerships",+ field_ids=[+ *_COMMON_FIELD_IDS,+ "name",+ "owner_identifier",+ "ownee_identifier",+ "ownership_type",+ "rank",+ ],+ ),}ENDPOINTS = tuple(CRUNCHBASE_ENDPOINTS.keys())diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/crunchbase/tests/test_crunchbase_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/crunchbase/tests/test_crunchbase_source.pyindex 571970eb421b..7db8fa49b3ee 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/crunchbase/tests/test_crunchbase_source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/crunchbase/tests/test_crunchbase_source.py@@ -1,7 +1,10 @@import pytestfrom unittest import mock-from products.warehouse_sources.backend.temporal.data_imports.sources.crunchbase.settings import ENDPOINTS+from products.warehouse_sources.backend.temporal.data_imports.sources.crunchbase.settings import (+ CRUNCHBASE_ENDPOINTS,+ ENDPOINTS,+)from products.warehouse_sources.backend.temporal.data_imports.sources.crunchbase.source import CrunchbaseSourcefrom products.warehouse_sources.backend.temporal.data_imports.sources.generated_configs.crunchbase import (CrunchbaseSourceConfig,@@ -36,6 +39,16 @@ class TestCrunchbaseSource:non_retryable_errors = self.source.get_non_retryable_errors()assert not any(key in other_vendor_error for key in non_retryable_errors)+ @pytest.mark.parametrize("endpoint", list(ENDPOINTS))+ def test_every_endpoint_has_canonical_descriptions(self, endpoint):+ # The shared catalog invariant only rejects descriptions for schemas that do not exist;+ # an endpoint added without them degrades to LLM enrichment without failing anything.+ descriptions = self.source.get_canonical_descriptions()++ assert endpoint in descriptions+ described = set(descriptions[endpoint].get("columns") or {})+ assert set(CRUNCHBASE_ENDPOINTS[endpoint].field_ids) - described == set()+def test_get_schemas(self):schemas = self.source.get_schemas(self.config, self.team_id)