~savoy/ade

48631dc664bda214739d993d4b8bdb495f3554ff — savoy 2 years ago d0ba0ed
feature: pivot and inclue_data override in pull

Allows full control of compilation steps if running a configuration from
reports.yaml.

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

M ade/lib/remote.py
M ade/lib/remote.py => ade/lib/remote.py +13 -1
@@ 1265,6 1265,9 @@ class Output:
        pivot_args : list[rep.PivotArgs], optional
            The arguments to pass in order to create a PivotTable.

        include_data : bool
            Saves the original dataframe in the compiled output.


        Returns
        -------


@@ 2949,6 2952,8 @@ def pull(
    subkey: str,
    slicers: dict = {},
    comp: dict = {},
    pivots: list[Optional[rep.PivotArgs]] = [None],
    include_data: bool = False,
) -> Compile:
    """Creates the query and pulls the data for the given report structure.



@@ 2966,6 2971,10 @@ def pull(
        Additional values used for specific reports in this module. For
        instance, equipment_report has a value "style" which can be modified
        here.
    pivots : list[rep.PivotArgs], optional
        The arguments to pass in order to create a PivotTable.
    include_data : bool
        Saves the original dataframe in the compiled output.

    Returns
    -------


@@ 2995,10 3004,13 @@ def pull(
        if key in report.compilate.args:
            setattr(report, key, value)

    if pivots:
        report.pivot = pivots

    # Construct the query and pull the data.
    out = Super(report).pull()

    compilate = out.compile()
    compilate = out.compile(include_data=include_data)

    return compilate