Skip to content

Refactor: Replace get_console().print() with console_print() helper#63561

Open
ad-m wants to merge 2 commits intoapache:mainfrom
ad-m:claude/unify-console-printing-cm4jZ
Open

Refactor: Replace get_console().print() with console_print() helper#63561
ad-m wants to merge 2 commits intoapache:mainfrom
ad-m:claude/unify-console-printing-cm4jZ

Conversation

@ad-m
Copy link
Contributor

@ad-m ad-m commented Mar 13, 2026

Description

This PR refactors console output calls throughout the Breeze codebase by replacing direct get_console().print() calls with a new console_print() helper function. This improves code consistency and maintainability by centralizing console output logic.

There was console_print() function in airflow_breeze/utils/console.py as a convenience wrapper around get_console().print(), but it was not widely used.

Changes Made

  • Updated imports across 30+ files to include console_print from the console utilities module
  • Replaced all instances of get_console().print(...) with console_print(...) throughout the codebase, including:
    • Release management commands
    • PR commands and triage actions
    • CI commands and ownership fixes
    • Docker command utilities
    • Kubernetes commands
    • Setup and configuration commands
    • Provider documentation and distribution utilities
    • Image building commands (CI and production)
    • Testing and test utilities
    • Various utility modules (packages, GitHub, parallel execution, etc.)

Benefits

  • Consistency: Single, standardized way to print console messages across the entire codebase
  • Maintainability: Future changes to console output behavior can be made in one place
  • Readability: Shorter, cleaner code compared to get_console().print()
  • Flexibility: The helper function can be extended with additional functionality if needed in the future

Testing

No testing needed - this is a straightforward refactoring that maintains identical behavior. All existing functionality is preserved, and the change is purely syntactic.

https://claude.ai/code/session_01XGwwP3viANwtiSBU4Kppdh


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Code / Opus 4.6


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Replace all direct get_console().print(...) calls with the console_print(...)
helper throughout the breeze codebase for consistency. Remove unused
get_console imports where it was only used for .print() calls.

https://claude.ai/code/session_01XGwwP3viANwtiSBU4Kppdh
@boring-cyborg boring-cyborg bot added area:dev-tools backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch labels Mar 13, 2026
@ad-m ad-m marked this pull request as draft March 13, 2026 20:08
The production code now uses console_print() directly, so tests need to
mock the console_print function rather than get_console().print.

https://claude.ai/code/session_01XGwwP3viANwtiSBU4Kppdh
@ad-m ad-m marked this pull request as ready for review March 13, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants