Skip to content

Commit

Permalink
feat: add --header option
Browse files Browse the repository at this point in the history
Skip the first row in the CSV file. By default, the tool omits the first
row with column names.
  • Loading branch information
malokhvii-eduard committed Oct 24, 2022
1 parent eade011 commit 91a8f93
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion raid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ def main(
"--debug",
help="Show information useful for debugging and for reporting bugs.",
),
header: bool = typer.Option(
True,
help=(
"Skip the first row in the CSV file. By default, the tool omits the first"
" row with column names."
),
),
) -> None:
"""
A simple tool to get immediate notifications in Slack once your Ukrainian
Expand Down Expand Up @@ -161,7 +168,7 @@ def main(
members_by_hashtag: Optional[Dict[str, List[str]]] = None
if members is not None:
members_df = pd.read_csv(
members, names=["member_id", "hashtag"], skiprows=1
members, names=["member_id", "hashtag"], skiprows=1 if header else 0
).drop_duplicates()

members_by_hashtag = defaultdict(
Expand Down

0 comments on commit 91a8f93

Please sign in to comment.