Skip to content

Commit

Permalink
Add docsstring
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajastro committed Jan 11, 2024
1 parent 01285c9 commit 6d34cda
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions airflow/include/tasks/split.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,11 @@ def split_html(dfs: list[pd.DataFrame]) -> pd.DataFrame:
return df


def split_list(urls: list[str], chunk_size: int = 0) -> list[list]:
return [urls[i : i + chunk_size] for i in range(0, len(urls), chunk_size)]
def split_list(urls: list[str], chunk_size: int = 0) -> list[list[str]]:
"""
split the list of string into chunk of list of string
param urls: URL list we want to chunk
param chunk_size: Max size of chunked list
"""
return [urls[i: i + chunk_size] for i in range(0, len(urls), chunk_size)]

0 comments on commit 6d34cda

Please sign in to comment.