: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 ownerrez spot rates table (#126969)
Tom Owers88a2a4876fb4
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 0383874edcdc..1d3262228e1f 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@@ -9033,6 +9033,7 @@ Diffed against: <https://api.ownerreservations.com/openapi/v2.json>- [ ] `Messages (GET /v2/messages)` — analyze guest communication volume and response times by booking thread (medium)- [ ] `Fields (GET /v2/fields)` — add custom entity attributes to booking, guest, and property analysis (medium)- [ ] `Tags (GET /v2/tags)` — group bookings and guests by assigned tags for cohort analysis (medium)+- [x] `Spot Rates (GET /v2/spotrates)` — raw per-night rate and stay-rule overrides, to separate manual pricing from seasonal defaults (medium). Added as `SpotRates` (full refresh, no date window).Note: Parsed the full OwnerRez v2 OpenAPI specification and inherited response schemas. Owners and listing sites resolve IDs in existing property, booking, and quote records. Calendar requests need date windows; messages need thread IDs and OAuth credentials. Listings have access limits; fields and tags need entity IDs; excluded authentication, webhooks, and pricing settings.diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/ownerrez/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/ownerrez/canonical_descriptions.pyindex 809cac243b92..ec203c91f67b 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/ownerrez/canonical_descriptions.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/ownerrez/canonical_descriptions.py@@ -248,4 +248,21 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {"rules": "Booking rules in effect for the night, such as minimum and maximum stay.",},},+ "SpotRates": {+ "description": "Manual per-night rate and stay-rule overrides (spot rates). One row per property night that has an override; nights without one use the seasonal or property defaults.",+ "docs_url": "https://api.ownerreservations.com/help/v2/spotrates/get-spotrates.md",+ "columns": {+ "property_id": "Identifier of the property the spot rate applies to. Unique together with date.",+ "date": "Property-local calendar date on which the spot rate is effective.",+ "amount": "Overridden nightly rate. Empty means the seasonal default rate applies.",+ "min_nights": "Minimum number of nights. Empty means the season or property rule applies.",+ "max_nights": "Maximum number of nights. Empty means the season or property rule applies.",+ "is_arrival_disallowed": "Whether arrival is disallowed on this date. Empty means the season or property rule applies.",+ "is_departure_disallowed": "Whether departure is disallowed on this date. Empty means the season or property rule applies.",+ "is_gap_required": "Whether only arrival or departure is allowed on this date, not both. When true, the arrival and departure rules are ignored.",+ "overrides_gap_arrival": "Whether the arrival rule applies even when gap rules exist.",+ "overrides_gap_departure": "Whether the departure rule applies even when gap rules exist.",+ "overrides_gap_min_nights": "Whether the minimum nights rule applies even when gap rules exist.",+ },+ },}diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/ownerrez/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/ownerrez/settings.pyindex 9f0f82a211d1..b8f85b153a00 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/ownerrez/settings.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/ownerrez/settings.py@@ -143,6 +143,15 @@ OWNERREZ_ENDPOINTS: dict[str, OwnerRezEndpointConfig] = {primary_keys=["property_id", "date"],partition_key=None,),+ "SpotRates": OwnerRezEndpointConfig(+ name="SpotRates",+ path="/v2/spotrates",+ # Sparse: one row per property night with a manual override. from/to are optional, and+ # omitting them returns every override, past and future. Rows carry no modified timestamp,+ # so this stays full refresh.+ primary_keys=["property_id", "date"],+ partition_key="date",+ ),}ENDPOINTS = tuple(OWNERREZ_ENDPOINTS.keys())diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/ownerrez/tests/test_ownerrez.py b/products/warehouse_sources/backend/temporal/data_imports/sources/ownerrez/tests/test_ownerrez.pyindex 29c40c320ae7..6fe73ea5fe60 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/ownerrez/tests/test_ownerrez.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/ownerrez/tests/test_ownerrez.py@@ -52,9 +52,11 @@ class TestBuildParams:)assert params == {"limit": PAGE_LIMIT, "created_since_utc": EPOCH}- def test_endpoint_without_since_param_never_filters(self) -> None:+ # SpotRates must not get a date window: unlike Calendar, from/to are optional and would drop past overrides.+ @parameterized.expand([("properties", "Properties"), ("spot_rates", "SpotRates")])+ def test_endpoint_without_since_param_never_filters(self, _name: str, endpoint: str) -> None:params = _build_params(- OWNERREZ_ENDPOINTS["Properties"],+ OWNERREZ_ENDPOINTS[endpoint],should_use_incremental_field=True,db_incremental_field_last_value=datetime(2026, 3, 4, tzinfo=UTC),)