~savoy/ade

7acf38d93b31f33cd0fb93b43ee2909d731d08c9 — savoy 2 years ago 48631dc
bug: incorrect handling of pivot type [None]

Signed-off-by: savoy <git@liberation.red>
2 files changed, 4 insertions(+), 4 deletions(-)

M ade/lib/remote.py
M ade/lib/reports.py
M ade/lib/remote.py => ade/lib/remote.py +1 -1
@@ 2952,7 2952,7 @@ def pull(
    subkey: str,
    slicers: dict = {},
    comp: dict = {},
    pivots: list[Optional[rep.PivotArgs]] = [None],
    pivots: Optional[list[rep.PivotArgs]] = None,
    include_data: bool = False,
) -> Compile:
    """Creates the query and pulls the data for the given report structure.

M ade/lib/reports.py => ade/lib/reports.py +3 -3
@@ 222,7 222,7 @@ class Report:
    required: RequiredArgs
    optional: OptionalArgs
    function: FunctionArgs
    pivot: list[Optional[PivotArgs]]
    pivot: Optional[list[PivotArgs]]
    compilate: CompilateArgs




@@ 656,7 656,7 @@ def parse(report_key: str, sub_key: str) -> Report:
    pull = [] if not pull else pull
    post = [] if not post else post
    comp = {} if not comp else comp
    pivot = [None] if not pivot else pivot
    pivot = [] if not pivot else pivot

    try:
        for idx, i in enumerate(pivot):


@@ 675,7 675,7 @@ def parse(report_key: str, sub_key: str) -> Report:
        required=base,
        optional=optional,
        function=FunctionArgs(pull, post),
        pivot=[PivotArgs(**i) if i else None for i in pivot],
        pivot=[PivotArgs(**i) for i in pivot],
        compilate=CompilateArgs(comp),
    )