Commit 76a50d62 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

set default to "" while extracting basis

parent fe4c9763
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ def override_common_keys(d1: dict, d2: dict) -> dict:

def extract_basis_table(dlist: list[dict], basis_keys: tuple) -> table.Table:
    """Extract basis key-value pairs from a list of dictionaries."""
    return table.Table([{k: d.get(k) for k in basis_keys} for d in dlist])
    return table.Table([{k: d.get(k, default="") for k in basis_keys} for d in dlist])


def split_data_basis(data_basis: table.Table, n_split: int = 1) -> list[table.Table]:
@@ -573,7 +573,7 @@ class Dispatcher:
        plan_basis: table.Table,
        data_basis: table.Table,
        # n_jobs: int = 1,
    ):
    ) -> list[dict]:
        # return an empty list if input is empty
        if len(plan_basis) == 0 or len(data_basis) == 0:
            return []