: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(data-warehouse): add fieldpulse tags, timesheets, teams and items tables (#119527)
Tom Owersf05ef85d9758
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 3d1b5d8c204e..7513103407fd 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@@ -4551,10 +4551,10 @@ Diffed against: <https://help.fieldpulse.com/openapi/fieldpulse-api.json>- [x] `Job status workflows and statuses (GET /jobs/status-workflows; GET /jobs/status-workflow-statuses)` — resolve status_workflow_id and status_id on jobs for completion and workload analysis (high)- [x] `Pipeline statuses (GET /pipeline-status)` — resolve pipeline_status_id on customers for sales funnel and conversion analysis (high)- [x] `Lead sources (GET /lead-source)` — resolve lead_source_id on customers to measure acquisition channels and resulting revenue (high)-- [ ] `Company teams (GET /teams)` — resolve team assignments on jobs and customers to compare team performance (high)-- [ ] `Invoice items (GET /items)` — resolve item references and compare products, costs, and billed quantities across invoices (high)-- [ ] `Tags (GET /tags)` — resolve customer tag IDs into named segments for conversion and revenue analysis (high)-- [ ] `Timesheets (GET /timesheets)` — measure labor hours, technician utilization, and labor costs alongside job revenue (high)+- [x] `Company teams (GET /teams)` — resolve team assignments on jobs and customers to compare team performance (high)+- [x] `Invoice items (GET /items)` — resolve item references and compare products, costs, and billed quantities across invoices (high)+- [x] `Tags (GET /tags)` — resolve customer tag IDs into named segments for conversion and revenue analysis (high)+- [x] `Timesheets (GET /timesheets)` — measure labor hours, technician utilization, and labor costs alongside job revenue (high)- [ ] `Purchase orders (GET /purchase-orders)` — compare material spending and procurement status with job and project revenue (medium)- [ ] `Comments (GET /comments)` — analyze internal communication and follow-up activity on jobs, customers, estimates, and invoices (medium)diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/fieldpulse/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/fieldpulse/canonical_descriptions.pyindex 76568da8e438..f0debf842954 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/fieldpulse/canonical_descriptions.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/fieldpulse/canonical_descriptions.py@@ -58,4 +58,24 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {"docs_url": "https://help.fieldpulse.com/api-reference/lead-source/retrieve-lead-sources-list","columns": {},},+ "tags": {+ "description": "Tags that label customers and jobs.",+ "docs_url": "https://help.fieldpulse.com/api-reference/tags/retrieve-tags-list",+ "columns": {},+ },+ "timesheets": {+ "description": "Timesheet entries that record when users clock in and out.",+ "docs_url": "https://help.fieldpulse.com/api-reference/timesheets/retrieve-timesheets-list",+ "columns": {},+ },+ "teams": {+ "description": "Teams of users in the company account.",+ "docs_url": "https://help.fieldpulse.com/api-reference/teams/retrieve-company-teams-list",+ "columns": {},+ },+ "items": {+ "description": "Items that can be added to invoices and estimates.",+ "docs_url": "https://help.fieldpulse.com/api-reference/items/retrieve-items-list",+ "columns": {},+ },}diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/fieldpulse/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/fieldpulse/settings.pyindex d27eaec63b62..261af99bc11d 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/fieldpulse/settings.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/fieldpulse/settings.py@@ -16,10 +16,16 @@ ENDPOINTS = {"job_status_workflow_statuses": "jobs/status-workflow-statuses","pipeline_statuses": "pipeline-status","lead_sources": "lead-source",+ "tags": "tags",+ "timesheets": "timesheets",+ "teams": "teams",+ "items": "items",}INCREMENTAL_ENDPOINTS = ("customers", "jobs", "estimates", "invoices", "payments", "projects")INCREMENTAL_FIELDS = {name: [incremental_field("updated_at")] for name in INCREMENTAL_ENDPOINTS}# The API reference lists no `page` parameter for these endpoints.-ENDPOINTS_WITHOUT_DOCUMENTED_PAGING = frozenset({"users", "job_status_workflows", "job_status_workflow_statuses"})+ENDPOINTS_WITHOUT_DOCUMENTED_PAGING = frozenset(+ {"users", "job_status_workflows", "job_status_workflow_statuses", "timesheets"}+)PRIMARY_KEYS = ["id"]AUTH_ERROR = "FieldPulse rejected the API key. Contact [email protected] to check that your key is active."diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/fieldpulse/tests/test_fieldpulse.py b/products/warehouse_sources/backend/temporal/data_imports/sources/fieldpulse/tests/test_fieldpulse.pyindex 141378738664..3f3098cd75d5 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/fieldpulse/tests/test_fieldpulse.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/fieldpulse/tests/test_fieldpulse.py@@ -95,7 +95,7 @@ def test_requests_and_pagination(][email protected]("endpoint", ["users", "job_status_workflows", "job_status_workflow_statuses"])[email protected]("endpoint", ["users", "job_status_workflows", "job_status_workflow_statuses", "timesheets"])@pytest.mark.parametrize("pages,expected_items,expected_pages",[