Skip to content

: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.

fix(data-warehouse): report a snowflake run as resumable only when it can resume (#112718)

Tom Owersc6ee55fb38d3
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/snowflake/snowflake.py b/products/warehouse_sources/backend/temporal/data_imports/sources/snowflake/snowflake.py
index b3fc273aa371..99acdaca402d 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/snowflake/snowflake.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/snowflake/snowflake.py
@@ -782,5 +782,11 @@ class SnowflakeImplementation(
yield batch
return SourceResponse(
- name=location.response_name, items=get_rows, primary_keys=primary_keys, rows_to_sync=rows_to_sync
+ name=location.response_name,
+ items=get_rows,
+ primary_keys=primary_keys,
+ rows_to_sync=rows_to_sync,
+ # `supports_resume` defaults to True. A run with no order column saves no checkpoint,
+ # so a hand-off would start it again from the first row, on each attempt.
+ supports_resume=order_column is not None,
)
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/snowflake/tests/test_snowflake.py b/products/warehouse_sources/backend/temporal/data_imports/sources/snowflake/tests/test_snowflake.py
index 1b0f2966a29d..b1b2bd789d4c 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/snowflake/tests/test_snowflake.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/snowflake/tests/test_snowflake.py
@@ -801,6 +801,7 @@ class TestResumableStreaming:
next(iterator)
# The final batch's checkpoint is never saved, so a post-extraction retry re-reads only it.
assert manager.save_state.call_count == 2
+ assert response.supports_resume is True
def test_resume_bounds_the_scan_and_skips_the_count(self, impl):
metadata_cursor = self._metadata_cursor()
@@ -856,6 +857,7 @@ class TestResumableStreaming:
assert "ORDER BY" not in query
assert streaming_cursor.execute.call_args.args[1] == ("DB.PUBLIC.messages",)
manager.save_state.assert_not_called()
+ assert response.supports_resume is False
def test_snowflake_source_is_resumable():