Skip to content

WEB: Sort PDEPs by their number #52072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 22, 2023
5 changes: 4 additions & 1 deletion web/pandas_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,10 @@ def roadmap_pdeps(context):
with open(pathlib.Path(context["target_path"]) / "pdeps.json", "w") as f:
json.dump(pdeps, f)

for pdep in sorted(pdeps["items"], key=operator.itemgetter("title")):
regex = "(?<=PDEP-)\\d+"
compiled_pattern = re.compile(regex)
get_num = lambda pdep: int(re.findall(compiled_pattern, pdep["title"])[0])
for pdep in sorted(pdeps["items"], key=get_num):
context["pdeps"]["Under discussion"].append(
{"title": pdep["title"], "url": pdep["html_url"]}
)
Expand Down