File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
airbyte_cdk/sources/streams/concurrent Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 44
55import functools
66import logging
7+ import os
78from abc import ABC , abstractmethod
89from typing import (
910 Any ,
@@ -237,12 +238,18 @@ def _extract_cursor_value(self, record: Record) -> Any:
237238 return self ._connector_state_converter .parse_value (self ._cursor_field .extract_value (record ))
238239
239240 def close_partition (self , partition : Partition ) -> None :
241+ test_env = os .getenv ("PYTEST_CURRENT_TEST" )
242+ if test_env and "test_concurrent_declarative_source.py" in test_env :
243+ LOGGER .info (f"Closing partition { partition .to_slice ()} " )
244+ LOGGER .info (f"\t state before is { self ._concurrent_state } " )
240245 slice_count_before = len (self ._concurrent_state .get ("slices" , []))
241246 self ._add_slice_to_state (partition )
242247 if slice_count_before < len (
243248 self ._concurrent_state ["slices" ]
244249 ): # only emit if at least one slice has been processed
245250 self ._merge_partitions ()
251+ if test_env and "test_concurrent_declarative_source.py" in test_env :
252+ LOGGER .info (f"\t state after merged partition is { self ._concurrent_state } " )
246253 self ._emit_state_message ()
247254 self ._has_closed_at_least_one_slice = True
248255
You can’t perform that action at this time.
0 commit comments