: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 4 missing tables to the Inflowinventory source (#120790)
Tom Owersde4365278ed2
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 becaa6e1bd13..3837903af8cd 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@@ -6312,11 +6312,11 @@ Diffed against: <https://cloudapi.inflowinventory.com/docs/api/swagger.json>- [x] `/{companyId}/categories` — lookup resolving product categoryId - the primary breakdown dimension for any sales or inventory report (high)- [x] `/{companyId}/stock-counts` — physical count cycles and their variances, for shrinkage and count-accuracy reporting (medium). Added as `stock_counts` (header rows only; per-product counts and variances live in `sheets`, which needs `include=sheets`, not requested yet).- [x] `/{companyId}/product-cost-adjustments` — cost basis changes over time, needed for correct COGS and margin on historical orders (medium)-- [ ] `/{companyId}/product-groups (+ /{productGroupId}/quantities/{locationId})` — product grouping lookup plus per-location on-hand quantities, the current-stock view products alone does not give (medium)-- [ ] `/{companyId}/adjustment-reasons` — lookup resolving the reason code on each stock adjustment - without it adjustments cannot be categorized (medium)+- [x] `/{companyId}/product-groups (+ /{productGroupId}/quantities/{locationId})` — product grouping lookup plus per-location on-hand quantities, the current-stock view products alone does not give (medium). Added as `product_groups` (list only; the per-group `quantities` route is not synced, because `products` already carries `totalQuantityOnHand`; per-location `inventoryLines` need `include=inventoryLines`, not requested yet).+- [x] `/{companyId}/adjustment-reasons` — lookup resolving the reason code on each stock adjustment - without it adjustments cannot be categorized (medium)- [x] `/{companyId}/tax-codes and /{companyId}/taxing-schemes` — lookups resolving tax IDs on order lines, needed to reconcile order totals (medium)-- [ ] `/{companyId}/currencies` — lookup with exchange rates, required to normalize multi-currency order totals (medium)-- [ ] `/{companyId}/team-members` — lookup resolving the user IDs that created or own orders, for per-rep performance reporting (medium)+- [x] `/{companyId}/currencies` — lookup with exchange rates, required to normalize multi-currency order totals (medium)+- [x] `/{companyId}/team-members` — lookup resolving the user IDs that created or own orders, for per-rep performance reporting (medium)Note: inFlow publishes a clean ReDoc/Swagger spec and even advertises it in a static header for scrapers, so this diff is exact. Also present but lower value and omitted: payment-terms, pricing-schemes, operation-types, stockroom-users, stockroom-scans, custom-field-definitions / custom-field-dropdown-options, report-settings. Webhooks and batch-job excluded as plumbing. Every path is company-scoped ({companyId} prefix), so the source already resolves a company ID and adding tables is mechanical.diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/inflowinventory/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/inflowinventory/canonical_descriptions.pyindex f542871fa18a..b90aeb816224 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/inflowinventory/canonical_descriptions.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/inflowinventory/canonical_descriptions.py@@ -227,4 +227,59 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {"timestamp": "The row version timestamp used for change tracking.",},},+ "product_groups": {+ "description": "A product group that bundles product variants (e.g. sizes or colors) under one parent item.",+ "docs_url": _DOCS_URL,+ "columns": {+ "productGroupId": "The unique ID of the product group.",+ "name": "The human-readable name of the product group. Unique within the account.",+ "categoryId": "The ID of the category assigned to the product group.",+ "defaultProductId": "The ID of the default product variant of the group.",+ "defaultImageId": "The ID of the default image of the product group.",+ "isActive": "Whether the product group is active.",+ "timestamp": "The row version timestamp used for change tracking.",+ },+ },+ "adjustment_reasons": {+ "description": "A reason code that categorizes a stock adjustment.",+ "docs_url": _DOCS_URL,+ "columns": {+ "adjustmentReasonId": "The unique ID of the adjustment reason.",+ "name": "A short description of the adjustment reason.",+ "isActive": "Whether the adjustment reason is active for new adjustments.",+ "isInternal": "Whether this is a system-generated adjustment reason that cannot be modified.",+ },+ },+ "currencies": {+ "description": "A currency used on orders, with its display format and conversion rates.",+ "docs_url": _DOCS_URL,+ "columns": {+ "currencyId": "The unique ID of the currency.",+ "name": "A descriptive name of the currency.",+ "isoCode": "The ISO 4217 code of the currency.",+ "symbol": "A short symbol that represents the currency.",+ "isSymbolFirst": "Whether the symbol is shown before the numerical value.",+ "decimalPlaces": "The number of decimal places typically shown with the currency.",+ "decimalSeparator": "The symbol that separates decimals for the currency.",+ "thousandsSeparator": "The symbol that separates thousands for the currency.",+ "negativeType": "How negative numbers are shown for the currency.",+ "currencyConversions": "The list of conversion rates related to the currency.",+ "timestamp": "The row version timestamp used for change tracking.",+ },+ },+ "team_members": {+ "description": "An inFlow user on the account. API keys and other non-user actors are not included.",+ "docs_url": _DOCS_URL,+ "columns": {+ "teamMemberId": "The unique ID of the team member.",+ "name": "The name of the team member.",+ "email": "The email address of the team member.",+ "isActive": "Whether the team member is an active inFlow user.",+ "isInternal": "Whether the team member is an internal inFlow system account.",+ "canBeSalesRep": "Whether the team member can be chosen as a sales rep.",+ "accessAllLocations": "Whether the team member has access to all locations.",+ "accessLocationIds": "The IDs of the locations the team member can access, when not all locations.",+ "accessRights": "The access rights given to the team member.",+ },+ },}diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/inflowinventory/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/inflowinventory/settings.pyindex 4386f1303e3d..568ec0553784 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/inflowinventory/settings.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/inflowinventory/settings.py@@ -46,6 +46,14 @@ INFLOWINVENTORY_ENDPOINTS: dict[str, InflowInventoryEndpointConfig] = {"taxing_schemes": InflowInventoryEndpointConfig(name="taxing_schemes", path="taxing-schemes", id_field="taxingSchemeId"),+ "product_groups": InflowInventoryEndpointConfig(+ name="product_groups", path="product-groups", id_field="productGroupId"+ ),+ "adjustment_reasons": InflowInventoryEndpointConfig(+ name="adjustment_reasons", path="adjustment-reasons", id_field="adjustmentReasonId"+ ),+ "currencies": InflowInventoryEndpointConfig(name="currencies", path="currencies", id_field="currencyId"),+ "team_members": InflowInventoryEndpointConfig(name="team_members", path="team-members", id_field="teamMemberId"),}ENDPOINTS = tuple(INFLOWINVENTORY_ENDPOINTS.keys())diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/inflowinventory/tests/test_inflowinventory.py b/products/warehouse_sources/backend/temporal/data_imports/sources/inflowinventory/tests/test_inflowinventory.pyindex 6f4dcb811722..19b263a4d990 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/inflowinventory/tests/test_inflowinventory.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/inflowinventory/tests/test_inflowinventory.py@@ -37,18 +37,22 @@ def _full_page(start_id: int, id_field: str = "productId") -> list[dict[str, Anyclass TestPagination:- def test_cursor_uses_per_endpoint_id_field(self) -> None:+ @parameterized.expand([(e,) for e in ENDPOINTS])+ def test_cursor_uses_per_endpoint_id_field(self, endpoint: str) -> None:+ config = INFLOWINVENTORY_ENDPOINTS[endpoint]last_id = str(PAGE_SIZE - 1)result = _driver().run(- "customers",+ endpoint,[- ScriptedResponse(json=_full_page(0, id_field="customerId")),- ScriptedResponse(json=[{"customerId": "9999"}]),+ ScriptedResponse(json=_full_page(0, id_field=config.id_field)),+ ScriptedResponse(json=[{config.id_field: "9999"}]),],)assert result.raised is None+ assert len(result.rows) == PAGE_SIZE + 1assert result.params("after") == [None, last_id]+ assert result.paths == [f"/co-123/{config.path}"] * 2def test_resumes_from_saved_cursor(self) -> None:# The unpaginated first page (after absent) must never be fetched on resume.