Skip to content

Commit 74098c9

Browse files
authored
Merge branch 'main' into feat/cli/login
2 parents a6d952f + a7b9e85 commit 74098c9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

codeflash/cli_cmds/cmd_init.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,13 +1276,16 @@ def enter_api_key_and_save_to_rc() -> None:
12761276

12771277

12781278
def create_find_common_tags_file(args: Namespace, file_name: str) -> Path:
1279-
find_common_tags_content = """def find_common_tags(articles: list[dict[str, list[str]]]) -> set[str]:
1279+
find_common_tags_content = """from __future__ import annotations
1280+
1281+
1282+
def find_common_tags(articles: list[dict[str, list[str]]]) -> set[str]:
12801283
if not articles:
12811284
return set()
12821285
1283-
common_tags = articles[0]["tags"]
1286+
common_tags = articles[0].get("tags", [])
12841287
for article in articles[1:]:
1285-
common_tags = [tag for tag in common_tags if tag in article["tags"]]
1288+
common_tags = [tag for tag in common_tags if tag in article.get("tags", [])]
12861289
return set(common_tags)
12871290
"""
12881291

0 commit comments

Comments
 (0)