Skip to content

Commit

Permalink
Change default for incomplete chunks to keep
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-nml committed Feb 22, 2024
1 parent ed391d9 commit 008e010
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
8 changes: 4 additions & 4 deletions nannyml/chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,14 @@ class SizeBasedChunker(Chunker):
"""

def __init__(self, chunk_size: int, incomplete: str = 'append', timestamp_column_name: Optional[str] = None):
def __init__(self, chunk_size: int, incomplete: str = 'keep', timestamp_column_name: Optional[str] = None):
"""Create a new SizeBasedChunker.
Parameters
----------
chunk_size: int
The preferred size of the resulting Chunks, i.e. the number of observations in each Chunk.
incomplete: str, default='append'
incomplete: str, default='keep'
Choose how to handle any leftover observations that don't make up a full Chunk.
The following options are available:
Expand Down Expand Up @@ -429,7 +429,7 @@ class CountBasedChunker(Chunker):
"""

def __init__(self, chunk_number: int, incomplete: str = 'append', timestamp_column_name: Optional[str] = None):
def __init__(self, chunk_number: int, incomplete: str = 'keep', timestamp_column_name: Optional[str] = None):
"""Creates a new CountBasedChunker.
It will calculate the amount of observations per chunk based on the given chunk count.
Expand All @@ -450,7 +450,7 @@ def __init__(self, chunk_number: int, incomplete: str = 'append', timestamp_colu
- ``'append'``: append leftover observations to the last complete Chunk (overfilling it)
Defaults to ``'append'``.
Defaults to ``'keep'``.
Returns
-------
Expand Down
6 changes: 0 additions & 6 deletions nannyml/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ class WriterConfig(BaseModel):
write_args: Optional[Dict[str, Any]]


class ChunkerConfig(BaseModel):
chunk_size: Optional[int]
chunk_period: Optional[str]
chunk_count: Optional[int]


class IntervalSchedulingConfig(BaseModel):
weeks: Optional[int]
days: Optional[int]
Expand Down

0 comments on commit 008e010

Please sign in to comment.