turbaszek commented on a change in pull request #13767:
URL: https://github.com/apache/airflow/pull/13767#discussion_r567715844



##########
File path: dev/provider_packages/prepare_provider_packages.py
##########
@@ -747,15 +750,31 @@ def convert_git_changes_to_table(changes: str, base_url: 
str) -> str:
         if line == "":
             continue
         full_hash, short_hash, date, message = line.split(" ", maxsplit=3)
-        table_data.append((f"[{short_hash}]({base_url}{full_hash})", date, 
message))
-    return tabulate(table_data, headers=headers, tablefmt="pipe")
+        message_without_backticks = message.replace("`", "'")
+        table_data.append(
+            (
+                f"[{short_hash}]({base_url}{full_hash})"
+                if markdown
+                else f"`{short_hash} <{base_url}{full_hash}>`_",
+                date,
+                f"`{message_without_backticks}`" if markdown else 
f"``{message_without_backticks}``",
+            )
+        )
+    table = tabulate(table_data, headers=headers, tablefmt="pipe" if markdown 
else "rst")
+    header = ""
+    if not markdown:
+        header += f"\n\n{print_version}\n" + "." * len(print_version) + "\n\n"
+        release_date = table_data[0][1]
+        header += f"Latest change: {release_date}\n\n"
+    return header + table

Review comment:
       Have you considered using rich for rendering the table instead of using 
tabulate + custom headers? I think using rich table make take less code and be 
easier to understand 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to