This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 7cd326ccbd fix: Repair defferable operator list in docs (#36476)
7cd326ccbd is described below
commit 7cd326ccbd5da03900b01695c74a805ced980855
Author: Kacper Muda <[email protected]>
AuthorDate: Thu Dec 28 21:07:22 2023 +0100
fix: Repair defferable operator list in docs (#36476)
---
docs/exts/operators_and_hooks_ref.py | 8 +++++++-
docs/exts/templates/deferrable_operators_list.rst.jinja2 | 7 ++++---
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/docs/exts/operators_and_hooks_ref.py
b/docs/exts/operators_and_hooks_ref.py
index e6ed70f259..272c8224a1 100644
--- a/docs/exts/operators_and_hooks_ref.py
+++ b/docs/exts/operators_and_hooks_ref.py
@@ -209,10 +209,16 @@ def _render_deferrable_operator_content(*,
header_separator: str):
)
if provider_info["operators"]:
+ provider_info["operators"] = sorted(provider_info["operators"])
provider_yaml_content =
yaml.safe_load(Path(provider_yaml_path).read_text())
provider_info["name"] = provider_yaml_content["package-name"]
providers.append(provider_info)
- return _render_template("deferrable_operators_list.rst.jinja2",
providers=providers)
+
+ return _render_template(
+ "deferrable_operators_list.rst.jinja2",
+ providers=sorted(providers, key=lambda p: p["name"]),
+ header_separator=header_separator,
+ )
class BaseJinjaReferenceDirective(Directive):
diff --git a/docs/exts/templates/deferrable_operators_list.rst.jinja2
b/docs/exts/templates/deferrable_operators_list.rst.jinja2
index 58f29d295a..cbeb1fc6be 100644
--- a/docs/exts/templates/deferrable_operators_list.rst.jinja2
+++ b/docs/exts/templates/deferrable_operators_list.rst.jinja2
@@ -17,15 +17,16 @@
under the License.
#}
{%- for provider in providers %}
-**{{ provider["name"] }}**
+{{ provider["name"] }}
+{{ header_separator * (provider['name']|length) }}
-.. list-table::F
+.. list-table::
:header-rows: 1
* - Modules
- Operators
{% for module, operator in provider["operators"] %}
* - :mod:`{{ module }}`
- - :mod:`{{ operator}}`
+ - :mod:`{{ operator }}`
{% endfor %}
{% endfor %}