Skip to content

Commit 326cb91

Browse files
fix: format code with ruff
Co-Authored-By: Aaron <AJ> Steers <[email protected]>
1 parent 78259c8 commit 326cb91

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

airbyte_cdk/sources/file_based/file_based_stream_reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def get_matching_files(
8585
8686
Utility method `self.filter_files_by_globs` and `self.get_prefixes_from_globs`
8787
are available, which may be helpful when implementing this method.
88-
88+
8989
Implementation should include logging:
9090
- At the beginning: logger.info(f"Starting to match files with glob patterns: {globs}")
9191
- After filtering files: logger.info(f"Completed matching files with glob patterns: {globs}")

airbyte_cdk/sources/file_based/stream/cursor/default_file_based_cursor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ def get_files_to_sync(
121121
f"It will instead use the time window of {self._time_window_if_history_is_full} to filter out files."
122122
)
123123
files_to_sync = [f for f in all_files if self._should_sync_file(f, logger)]
124-
logger.info(f"Determined {len(files_to_sync)} files to sync out of {len(list(all_files))} total files")
124+
logger.info(
125+
f"Determined {len(files_to_sync)} files to sync out of {len(list(all_files))} total files"
126+
)
125127
return files_to_sync
126128

127129
def get_start_time(self) -> datetime:

airbyte_cdk/sources/file_based/stream/default_file_based_stream.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,9 @@ def get_files(self) -> Iterable[RemoteFile]:
342342
)
343343

344344
def infer_schema(self, files: List[RemoteFile]) -> Mapping[str, Any]:
345-
self.logger.info(f"Starting schema inference for stream {self.name} with {len(files)} files")
345+
self.logger.info(
346+
f"Starting schema inference for stream {self.name} with {len(files)} files"
347+
)
346348
loop = asyncio.get_event_loop()
347349
schema = loop.run_until_complete(self._infer_schema(files))
348350
# as infer schema returns a Mapping that is assumed to be immutable, we need to create a deepcopy to avoid modifying the reference
@@ -377,7 +379,9 @@ async def _infer_schema(self, files: List[RemoteFile]) -> Mapping[str, Any]:
377379
Each file type has a corresponding `infer_schema` handler.
378380
Dispatch on file type.
379381
"""
380-
self.logger.info(f"Starting concurrent schema inference for {len(files)} files with {self._discovery_policy.n_concurrent_requests} concurrent requests")
382+
self.logger.info(
383+
f"Starting concurrent schema inference for {len(files)} files with {self._discovery_policy.n_concurrent_requests} concurrent requests"
384+
)
381385
base_schema: SchemaType = {}
382386
pending_tasks: Set[asyncio.tasks.Task[SchemaType]] = set()
383387

@@ -397,7 +401,9 @@ async def _infer_schema(self, files: List[RemoteFile]) -> Mapping[str, Any]:
397401
)
398402
for task in done:
399403
try:
400-
self.logger.debug(f"Completed schema inference for a file, {len(pending_tasks)} files remaining")
404+
self.logger.debug(
405+
f"Completed schema inference for a file, {len(pending_tasks)} files remaining"
406+
)
401407
base_schema = merge_schemas(base_schema, task.result())
402408
except AirbyteTracedException as ate:
403409
raise ate

0 commit comments

Comments
 (0)