Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airbyte/_util/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def set_mcp_mode() -> None:
This should be called early in MCP server initialization to ensure
proper detection and prevent interactive prompts.
"""
print(
print( # noqa: T201
"Running in MCP mode: "
f"Airbyte Replication MCP v{get_version()} (Python v{python_version()})",
file=sys.stderr,
Expand Down
6 changes: 3 additions & 3 deletions airbyte/_util/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def _setup_analytics() -> str | bool:

if not _ANALYTICS_FILE.exists():
# This is a one-time message to inform the user that we are tracking anonymous usage stats.
print(
print( # noqa: T201
"Thank you for using Airbyte!\n"
"Anonymous usage reporting is currently enabled. For more information, please"
" see https://docs.airbyte.com/telemetry",
Expand All @@ -127,7 +127,7 @@ def _setup_analytics() -> str | bool:
return analytics["anonymous_user_id"]

issues.append("Provided analytics ID did not match the file. Rewriting the file.")
print(
print( # noqa: T201
f"Received a user-provided analytics ID override in the '{_ENV_ANALYTICS_ID}' "
"environment variable.",
file=sys.stderr,
Expand All @@ -150,7 +150,7 @@ def _setup_analytics() -> str | bool:

if DEBUG and issues:
nl = "\n"
print(
print( # noqa: T201
f"One or more issues occurred when configuring usage tracking:\n{nl.join(issues)}",
file=sys.stderr,
)
Expand Down
2 changes: 1 addition & 1 deletion airbyte/caches/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def get_colab_cache(
cache_dir.mkdir(parents=True, exist_ok=True)
db_file_path = cache_dir / f"{cache_name}.duckdb"

print(f"Using persistent PyAirbyte cache in Google Drive: `{db_file_path}`.")
print(f"Using persistent PyAirbyte cache in Google Drive: `{db_file_path}`.") # noqa: T201
return DuckDBCache(
db_path=db_file_path,
cache_dir=cache_dir,
Expand Down
16 changes: 8 additions & 8 deletions airbyte/cli/pyab.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,11 @@ def validate(
use_python=use_python,
)

print("Getting `spec` output from connector...", file=sys.stderr)
print("Getting `spec` output from connector...", file=sys.stderr) # noqa: T201
connector_obj.print_config_spec(stderr=True)

if config:
print("Running connector check...")
print("Running connector check...") # noqa: T201
config_dict: dict[str, Any] = _resolve_config(config)
connector_obj.set_config(config_dict)
connector_obj.check()
Expand Down Expand Up @@ -526,7 +526,7 @@ def benchmark(
else get_noop_destination()
)

print("Running benchmarks...", file=sys.stderr)
print("Running benchmarks...", file=sys.stderr) # noqa: T201
destination_obj.write(
source_data=source_obj,
cache=False,
Expand Down Expand Up @@ -621,7 +621,7 @@ def sync(
use_python=use_python,
)

print("Running sync...")
print("Running sync...") # noqa: T201
destination_obj.write(
source_data=source_obj,
cache=False,
Expand Down Expand Up @@ -749,15 +749,15 @@ def destination_smoke_test( # noqa: PLR0913
--config=./secrets/snowflake.json
--reuse-namespace=zz_deleteme_20260318_2256`
"""
print("Resolving destination...", file=sys.stderr)
print("Resolving destination...", file=sys.stderr) # noqa: T201
destination_obj = _resolve_destination_job(
destination=destination,
config=config,
pip_url=pip_url,
use_python=use_python,
)

print("Running destination smoke test...", file=sys.stderr)
print("Running destination smoke test...", file=sys.stderr) # noqa: T201
result = run_destination_smoke_test(
destination=destination_obj,
scenarios=scenarios,
Expand All @@ -767,11 +767,11 @@ def destination_smoke_test( # noqa: PLR0913
skip_preflight=skip_preflight,
)

print(json.dumps(result.model_dump(), indent=2))
print(json.dumps(result.model_dump(), indent=2)) # noqa: T201

if not result.success:
if result.error:
print(f"Smoke test FAILED: {result.error}", file=sys.stderr)
print(f"Smoke test FAILED: {result.error}", file=sys.stderr) # noqa: T201
sys.exit(1)


Expand Down
2 changes: 1 addition & 1 deletion airbyte/cloud/workspaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def connect(self) -> None:
client_secret=self.client_secret,
bearer_token=self.bearer_token,
)
print(f"Successfully connected to workspace: {self.workspace_url}")
print(f"Successfully connected to workspace: {self.workspace_url}") # noqa: T201

# Get sources, destinations, and connections

Expand Down
6 changes: 3 additions & 3 deletions airbyte/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def get_global_file_logger() -> logging.Logger | None:
return None

logfile_path = folder / f"airbyte-log-{str(ulid.ULID())[2:11]}.log"
print(f"Writing PyAirbyte logs to file: {logfile_path!s}", file=sys.stderr)
print(f"Writing PyAirbyte logs to file: {logfile_path!s}", file=sys.stderr) # noqa: T201

file_handler = logging.FileHandler(
filename=logfile_path,
Expand Down Expand Up @@ -246,7 +246,7 @@ def get_global_stats_logger() -> structlog.BoundLogger:
# No temp directory available, so return no-op logger without handlers
return structlog.get_logger("airbyte.stats")

print(f"Writing PyAirbyte performance stats to file: {logfile_path!s}", file=sys.stderr)
print(f"Writing PyAirbyte performance stats to file: {logfile_path!s}", file=sys.stderr) # noqa: T201

# Remove any existing handlers
for handler in logger.handlers:
Expand Down Expand Up @@ -303,7 +303,7 @@ def new_passthrough_file_logger(connector_name: str) -> logging.Logger:
global_logger = get_global_file_logger()
logfile_path = folder / f"{connector_name}-log-{str(ulid.ULID())[2:11]}.log"
logfile_msg = f"Writing `{connector_name}` logs to file: {logfile_path!s}"
print(logfile_msg, file=sys.stderr)
print(logfile_msg, file=sys.stderr) # noqa: T201
if global_logger:
global_logger.info(logfile_msg)

Expand Down
2 changes: 1 addition & 1 deletion airbyte/mcp/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ def read_source_stream_records(
# Next we load a limited number of records from the generator into our list.
records: list[dict[str, Any]] = list(islice(record_generator, max_records))

print(f"Retrieved {len(records)} records from stream '{stream_name}'", sys.stderr)
print(f"Retrieved {len(records)} records from stream '{stream_name}'", sys.stderr) # noqa: T201

except Exception as ex:
tb_str = traceback.format_exc()
Expand Down
8 changes: 4 additions & 4 deletions airbyte/mcp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,16 @@ def main() -> None:
It should not be called directly; instead, consult the MCP client documentation
for instructions on how to connect to the server.
"""
print("Starting Airbyte MCP server.", file=sys.stderr)
print("Starting Airbyte MCP server.", file=sys.stderr) # noqa: T201
try:
asyncio.run(app.run_stdio_async())
except KeyboardInterrupt:
print("Airbyte MCP server interrupted by user.", file=sys.stderr)
print("Airbyte MCP server interrupted by user.", file=sys.stderr) # noqa: T201
except Exception as ex:
print(f"Error running Airbyte MCP server: {ex}", file=sys.stderr)
print(f"Error running Airbyte MCP server: {ex}", file=sys.stderr) # noqa: T201
sys.exit(1)

print("Airbyte MCP server stopped.", file=sys.stderr)
print("Airbyte MCP server stopped.", file=sys.stderr) # noqa: T201


if __name__ == "__main__":
Expand Down
6 changes: 3 additions & 3 deletions airbyte/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def _log_sync_start(self) -> None:
)

def _log_sync_cancel(self) -> None:
print(
print( # noqa: T201
f"Canceled `{self.job_description}` sync at `{ab_datetime_now().strftime('%H:%M:%S')}`."
)
self._send_telemetry(
Expand All @@ -441,7 +441,7 @@ def _log_sync_cancel(self) -> None:
)

def _log_stream_read_start(self, stream_name: str) -> None:
print(
print( # noqa: T201
f"Read started on stream `{stream_name}` at "
f"`{ab_datetime_now().strftime('%H:%M:%S')}`..."
)
Expand Down Expand Up @@ -618,7 +618,7 @@ def log_success(
else:
streams_str = f" ({len(streams)} streams)"

print(
print( # noqa: T201
f"Completed `{self.job_description}` sync at "
f"`{ab_datetime_now().strftime('%H:%M:%S')}`{streams_str}."
)
Expand Down
2 changes: 1 addition & 1 deletion airbyte/secrets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def write_to_file(
This method is a convenience method that writes the secret to a file as text.
"""
if not silent:
print(
print( # noqa: T201
f"Writing secret '{self.secret_name.split('/')[-1]}' to '{file_path.absolute()!s}'"
)

Expand Down
4 changes: 2 additions & 2 deletions airbyte/shared/sql_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1200,8 +1200,8 @@ def _emulated_merge_temp_table_to_final_table(
)

if DEBUG_MODE:
print(str(update_stmt))
print(str(insert_new_records_stmt))
print(str(update_stmt)) # noqa: T201
print(str(insert_new_records_stmt)) # noqa: T201

with self.get_sql_connection() as conn:
conn.execute(update_stmt)
Expand Down
2 changes: 1 addition & 1 deletion airbyte/shared/state_writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def _write_state(
state_message: AirbyteStateMessage,
) -> None:
"""Save or 'write' a state artifact."""
print(state_message.model_dump_json())
print(state_message.model_dump_json()) # noqa: T201


class NoOpStateWriter(StateWriterBase):
Expand Down
6 changes: 3 additions & 3 deletions docs/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _regenerate_mcp_markdown() -> None:
"""
script = pathlib.Path(__file__).parent.parent / "scripts" / "generate_mcp_markdown.py"
if not script.exists():
print(f"[docs-generate] MCP markdown generator not found at {script}; skipping.")
print(f"[docs-generate] MCP markdown generator not found at {script}; skipping.") # noqa: T201
return
try:
spec = importlib.util.spec_from_file_location("_mcp_markdown_gen", script)
Expand All @@ -51,13 +51,13 @@ def _regenerate_mcp_markdown() -> None:
raise RuntimeError(msg) # noqa: TRY301
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
print("[docs-generate] Regenerating docs/mcp-generated/ ...")
print("[docs-generate] Regenerating docs/mcp-generated/ ...") # noqa: T201
module.generate(
server_spec=module.DEFAULT_SERVER_SPEC,
output=module.DEFAULT_OUTPUT,
)
except Exception as ex:
print(
print( # noqa: T201
f"[docs-generate] WARNING: failed to regenerate MCP Markdown docs: {ex}. "
"pdoc will continue, but module pages may show missing include warnings.",
file=sys.stderr,
Expand Down
2 changes: 1 addition & 1 deletion examples/run_bigquery_faker.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def main() -> None:
result = source.read(cache)

for name, records in result.streams.items():
print(f"Stream {name}: {len(records)} records")
print(f"Stream {name}: {len(records)} records") # noqa: T201


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions examples/run_declarative_manifest_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@

source_manifest_dict = cast(dict, yaml.safe_load(SOURCE_MANIFEST_TEXT))

print("Installing declarative source...")
print("Installing declarative source...") # noqa: T201
source = get_source(
"source-rick-and-morty",
config={},
Expand All @@ -178,4 +178,4 @@
result = source.read()

for name, records in result.streams.items():
print(f"Stream {name}: {len(records)} records")
print(f"Stream {name}: {len(records)} records") # noqa: T201
8 changes: 4 additions & 4 deletions examples/run_downloadable_yaml_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

yaml_connectors: list[str] = ab.get_available_connectors(install_type="yaml")

print(
print( # noqa: T201
f"Downloadable yaml sources ({len(yaml_connectors)}): \n- "
+ "\n- ".join(yaml_connectors)
)
Expand All @@ -32,13 +32,13 @@

# Print any connector failures, grouped by the error message
for error, connectors_failed in failed_installs.items():
print(
print( # noqa: T201
f"\nInstallation Errors ({len(failed_installs)}): {error}\n- "
+ "\n- ".join(connectors_failed)
+ "\n"
)

print("Running declarative source...")
print("Running declarative source...") # noqa: T201
source = get_source(
"source-pokeapi",
config={
Expand All @@ -52,4 +52,4 @@
result = source.read()

for name, records in result.streams.items():
print(f"Stream {name}: {len(records)} records")
print(f"Stream {name}: {len(records)} records") # noqa: T201
4 changes: 2 additions & 2 deletions examples/run_faker.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
force_full_refresh=FORCE_FULL_REFRESH,
)

print("Read complete. Validating results...")
print("Read complete. Validating results...") # noqa: T201
for name, records in result.streams.items():
print(f"Stream {name}: {len(records)} records")
print(f"Stream {name}: {len(records)} records") # noqa: T201
2 changes: 1 addition & 1 deletion examples/run_faker_to_motherduck.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
result = source.read(cache=cache, force_full_refresh=True)

for name, records in result.streams.items():
print(f"Stream {name}: {len(records)} records")
print(f"Stream {name}: {len(records)} records") # noqa: T201
4 changes: 2 additions & 2 deletions examples/run_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
])

result = source.read(cache=ab.new_local_cache("github"))
print(result.processed_records)
print(result.processed_records) # noqa: T201

for name, records in result.streams.items():
print(f"Stream {name}: {len(records)} records")
print(f"Stream {name}: {len(records)} records") # noqa: T201
4 changes: 2 additions & 2 deletions examples/run_integ_test_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ def main(
cache = ab.new_local_cache()
try:
read_result = source.read(cache=cache)
print(
print( # noqa: T201
f"Read from `{connector_name}` was successful. ",
f"Cache results were saved to: {cache.cache_dir}",
f"Streams list: {', '.join(read_result.streams.keys())}",
)
except Exception:
print(
print( # noqa: T201
f"Read from `{connector_name}` failed. ",
f"Cache files are located at: {cache.cache_dir}",
)
Expand Down
2 changes: 1 addition & 1 deletion examples/run_snowflake_faker.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@
result = source.read(cache)

for name in ["products"]:
print(f"Stream {name}: {len(list(result[name]))} records")
print(f"Stream {name}: {len(list(result[name]))} records") # noqa: T201
4 changes: 2 additions & 2 deletions examples/run_spacex.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

result = source.read(cache)

print(islice(source.get_records("capsules"), 10))
print(islice(source.get_records("capsules"), 10)) # noqa: T201

for name, records in result.cache.streams.items():
print(f"Stream {name}: {len(list(records))} records")
print(f"Stream {name}: {len(list(records))} records") # noqa: T201
4 changes: 2 additions & 2 deletions examples/run_sync_to_destination_from_read_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ def main() -> None:
read_result: ab.ReadResult = source.read(
cache=ab.new_local_cache(),
)
print(
print( # noqa: T201
"Completed reading from source at "
f"{datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}. "
"Writing to destination..."
)
write_result: ab.WriteResult = destination.write(
source_data=read_result,
)
print(
print( # noqa: T201
f"Completed writing {write_result.processed_records:,} records "
f"to destination at {datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}."
)
Expand Down
2 changes: 1 addition & 1 deletion examples/run_sync_to_destination_w_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def main() -> None:
source_data=source,
cache=ab.new_local_cache(),
)
print(
print( # noqa: T201
f"Completed writing {write_result.processed_records:,} records "
f"to destination at {datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}."
)
Expand Down
Loading
Loading