https://prefect.io logo
#prefect-community
Title
# prefect-community
l

Leon Kozlowski

02/14/2023, 6:28 PM
Any time I try to write unit tests for a flow with mapped tasks, I am getting a
MappingLengthMismatch
with the following traceback
Copy code
Parameters for map must all be the same length. Got lengths: {'args': 0, 'kwargs': 2}
However, all of the parameters for the task do have the same length
1
For example: The task I'm testing is
load
and it takes a parameter called
sync
Copy code
loads = load.map(
    sync=[data_usage_per_cycle, sim_status, device_change_history],
    expected_start_time=unmapped(expected_start_time)
)
The array passed to
load
contains
Copy code
(Pdb) data_usage_per_cycle
('schema', 'table1', [{'data': 'here'}])
(Pdb) sim_status
('schema', 'table2', [{'data': 'here'}])
(Pdb) device_change_history
('schema', 'table3', [{'data': 'here'}])
A list of tuples
z

Zanie

02/14/2023, 7:25 PM
Support for **kwargs is still in progress https://github.com/PrefectHQ/prefect/pull/8188
2 Views