This is an automated email from the ASF dual-hosted git repository.
vatsrahul1001 pushed a commit to branch v3-4-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-4-test by this push:
new a64787ed048 [v3-4-test] Remove unused Breeze snippet helpers (#75854)
(#75866)
a64787ed048 is described below
commit a64787ed048aa1e2202cf1b6d4de373331c088bb
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Oct 30 21:25:14 2026 +0530
[v3-4-test] Remove unused Breeze snippet helpers (#75854) (#75866)
(cherry picked from commit ddb02d81b269c718ea8ad2b078d2d0d687c838f8)
Co-authored-by: Hussein Awala <[email protected]>
---
.../airflow_breeze/utils/publish_docs_helpers.py | 32 ----------------------
1 file changed, 32 deletions(-)
diff --git a/dev/breeze/src/airflow_breeze/utils/publish_docs_helpers.py
b/dev/breeze/src/airflow_breeze/utils/publish_docs_helpers.py
index e3f4265e760..e81cb321daf 100644
--- a/dev/breeze/src/airflow_breeze/utils/publish_docs_helpers.py
+++ b/dev/breeze/src/airflow_breeze/utils/publish_docs_helpers.py
@@ -18,7 +18,6 @@
from __future__ import annotations
import os
-from pathlib import Path
from airflow_breeze.utils.path_utils import (
AIRFLOW_ROOT_PATH,
@@ -29,40 +28,9 @@ CONSOLE_WIDTH = 180
PROVIDER_DATA_SCHEMA_PATH = AIRFLOW_ROOT_PATH / "airflow" /
"provider.yaml.schema.json"
-def _filepath_to_module(filepath: str):
- return str(Path(filepath).relative_to(AIRFLOW_ROOT_PATH)).replace("/", ".")
-
-
def pretty_format_path(path: str, start: str) -> str:
"""Formats path nicely."""
relpath = os.path.relpath(path, start)
if relpath == path:
return path
return f"{start}/{relpath}"
-
-
-def prepare_code_snippet(file_path: str, line_no: int, context_lines_count:
int = 5) -> str:
- """
- Prepare code snippet with line numbers and a specific line marked.
-
- :param file_path: File name
- :param line_no: Line number
- :param context_lines_count: The number of lines that will be cut before
and after.
- :return: str
- """
- with open(file_path) as text_file:
- # Highlight code
- code = text_file.read()
- code_lines = code.splitlines()
- # Prepend line number
- code_lines = [
- f">{lno:3} | {line}" if line_no == lno else f"{lno:4} | {line}"
- for lno, line in enumerate(code_lines, 1)
- ]
- # # Cut out the snippet
- start_line_no = max(0, line_no - context_lines_count - 1)
- end_line_no = line_no + context_lines_count
- code_lines = code_lines[start_line_no:end_line_no]
- # Join lines
- code = "\n".join(code_lines)
- return code