Skip to content

Commit

Permalink
style: change the filter to pivot_filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Zncl2222 committed Sep 9, 2024
1 parent 1b4c0ca commit 5ca1af4
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/pivot.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Represents a PivotTable configuration, including data ranges, field settings, an
| `data_range` | `str` | Range of data used for the pivot table, e.g., "Sheet1!A1:B2". |
| `pivot_table_range` | `str` | Range where the pivot table will be placed, e.g., "Sheet1!C3:D4". |
| `rows` | `list[PivotTableField]` | List of fields used as rows in the pivot table. |
| `filter` | `list[PivotTableField]` | List of fields used as filters in the pivot table. |
| `pivot_filter` | `list[PivotTableField]` | List of fields used as filters in the pivot table. |
| `columns` | `list[PivotTableField]` | List of fields used as columns in the pivot table. |
| `data` | `list[PivotTableField]` | List of fields used as data fields in the pivot table. |
| `row_grand_totals` | `Optional[bool]` | Indicates whether to display row grand totals. |
Expand Down
2 changes: 1 addition & 1 deletion docs/workbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ wb.add_pivot_table('Sheet1', pivot_table=[pivot_table_object1, pivot_table_objec
| `data_range` | `str` | The range of data to be used in the pivot table, e.g., `"Sheet1!A1:B2"`. |
| `pivot_table_range` | `str` | The range where the pivot table will be positioned, e.g., `"Sheet1!C3:D4"`. |
| `rows` | `list[PivotTableField]` | List of fields used as rows in the pivot table. |
| `filter` | `list[PivotTableField]` | List of fields used as filters in the pivot table. |
| `pivot_filter` | `list[PivotTableField]` | List of fields used as filters in the pivot table. |
| `columns` | `list[PivotTableField]` | List of fields used as columns in the pivot table. |
| `data` | `list[PivotTableField]` | List of fields used as data fields in the pivot table. |
| `row_grand_totals` | `Optional[bool]` | Whether to display row grand totals. |
Expand Down
2 changes: 1 addition & 1 deletion docs/worksheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ ws.add_pivot_table(pivot_table=[pivot_table_object1, pivot_table_object2])
| `data_range` | `str` | The range of data to be used in the pivot table, e.g., `"Sheet1!A1:B2"`. |
| `pivot_table_range` | `str` | The range where the pivot table will be positioned, e.g., `"Sheet1!C3:D4"`. |
| `rows` | `list[PivotTableField]` | List of fields used as rows in the pivot table. |
| `filter` | `list[PivotTableField]` | List of fields used as filters in the pivot table. |
| `pivot_filter` | `list[PivotTableField]` | List of fields used as filters in the pivot table. |
| `columns` | `list[PivotTableField]` | List of fields used as columns in the pivot table. |
| `data` | `list[PivotTableField]` | List of fields used as data fields in the pivot table. |
| `row_grand_totals` | `Optional[bool]` | Whether to display row grand totals. |
Expand Down
4 changes: 2 additions & 2 deletions pyfastexcel/pivot.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class PivotTable(BaseModel):
data_range (str): The range of data to be used in the pivot table, e.g., "Sheet1!A1:B2".
pivot_table_range (str): The range where the pivot table will be positioned, e.g., "Sheet1!C3:D4".
rows (list[PivotTableField]): List of fields used as rows in the pivot table.
filter ([PivotTableField]): List of fields used as filters in the pivot table.
pivot_filter ([PivotTableField]): List of fields used as filters in the pivot table.
columns (list[PivotTableField]): List of fields used as columns in the pivot table.
data (list[PivotTableField]): List of fields used as data fields in the pivot table.
row_grand_totals (Optional[bool Indicates whether to show row grand totals.
Expand All @@ -78,7 +78,7 @@ class PivotTable(BaseModel):
data_range: str = Field(..., serialization_alias='DataRange')
pivot_table_range: str = Field(..., serialization_alias='PivotTableRange')
rows: list[PivotTableField] = Field([PivotTableField()], serialization_alias='Rows')
filter: list[PivotTableField] = Field([PivotTableField()], serialization_alias='Filter')
pivot_filter: list[PivotTableField] = Field([PivotTableField()], serialization_alias='Filter')
columns: list[PivotTableField] = Field([PivotTableField()], serialization_alias='Columns')
data: list[PivotTableField] = Field([PivotTableField()], serialization_alias='Data')
row_grand_totals: Optional[bool] = Field(None, serialization_alias='RowGrandTotals')
Expand Down
6 changes: 3 additions & 3 deletions pyfastexcel/workbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def add_pivot_table(
data_range: str,
pivot_table_range: str,
rows: list[PivotTableField],
filter: list[PivotTableField],
pivot_filter: list[PivotTableField],
columns: list[PivotTableField],
data: list[PivotTableField],
row_grand_totals: Optional[bool],
Expand All @@ -436,7 +436,7 @@ def add_pivot_table(
data_range: Optional[str] = None,
pivot_table_range: Optional[str] = None,
rows: Optional[list[PivotTableField]] = None,
filter: Optional[list[PivotTableField]] = None,
pivot_filter: Optional[list[PivotTableField]] = None,
columns: Optional[list[PivotTableField]] = None,
data: Optional[list[PivotTableField]] = None,
row_grand_totals: Optional[bool] = None,
Expand All @@ -462,7 +462,7 @@ def add_pivot_table(
data_range=data_range,
pivot_table_range=pivot_table_range,
rows=rows,
filter=filter,
pivot_filter=pivot_filter,
columns=columns,
data=data,
row_grand_totals=row_grand_totals,
Expand Down
6 changes: 3 additions & 3 deletions pyfastexcel/worksheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ def add_pivot_table(
data_range: str,
pivot_table_range: str,
rows: list[PivotTableField] = None,
filter: list[PivotTableField] = None,
pivot_filter: list[PivotTableField] = None,
columns: list[PivotTableField] = None,
data: list[PivotTableField] = None,
row_grand_totals: Optional[bool] = None,
Expand Down Expand Up @@ -934,7 +934,7 @@ def add_pivot_table(
data_range: Optional[str] = None,
pivot_table_range: Optional[str] = None,
rows: Optional[list[PivotTableField]] = None,
filter: Optional[list[PivotTableField]] = None,
pivot_filter: Optional[list[PivotTableField]] = None,
columns: Optional[list[PivotTableField]] = None,
data: Optional[list[PivotTableField]] = None,
row_grand_totals: Optional[bool] = None,
Expand Down Expand Up @@ -964,7 +964,7 @@ def add_pivot_table(
data_range=data_range,
pivot_table_range=pivot_table_range,
rows=rows,
filter=filter,
pivot_filter=pivot_filter,
columns=columns,
data=data,
row_grand_totals=row_grand_totals,
Expand Down
6 changes: 3 additions & 3 deletions tests/pivot_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_pivot_table(case):
PivotTableField(data='Month', default_subtotal=True),
PivotTableField(data='Year'),
],
filter=[PivotTableField(data='mart')],
pivot_filter=[PivotTableField(data='mart')],
columns=[PivotTableField(data='Type', default_subtotal=True)],
data=[PivotTableField(data='Sales', name='Summarize', subtotal='sum')],
row_grand_totals=True,
Expand All @@ -74,7 +74,7 @@ def test_pivot_table(case):
PivotTableField(data='Month', default_subtotal=True),
PivotTableField(data='Year'),
],
filter=[PivotTableField(data='mart')],
pivot_filter=[PivotTableField(data='mart')],
columns=[PivotTableField(data='Type', default_subtotal=True)],
data=[PivotTableField(data='Sales', name='Summarize', subtotal='sum')],
row_grand_totals=True,
Expand All @@ -92,7 +92,7 @@ def test_pivot_table(case):
PivotTableField(data='Month', default_subtotal=True),
PivotTableField(data='Year'),
],
filter=[PivotTableField(data='mart')],
pivot_filter=[PivotTableField(data='mart')],
columns=[PivotTableField(data='Type', default_subtotal=True)],
data=[PivotTableField(data='Sales', name='Summarize', subtotal='sum')],
row_grand_totals=True,
Expand Down

0 comments on commit 5ca1af4

Please sign in to comment.