Azure / Azure/Azure-DataFactory
Data types mismatch when running pipeline from .NET API
- Dominant language
- PowerShell
- Stars
- 529
- Forks
- 623
- PR merge metrics
- No merged PRs in 30d
Description
Hey there, I found what seems to be a bug in ADF.
When running a pipeline from external application (.NET API), parameters of boolean type are passed, however they are later treated as strings, but only in 'ifs' written in expressions, in which parameters are passed to a nested pipeline.
It required adding explicit casting of these parameters as bool, like that: @if(bool(pipeline().parameters.param_name), 'val_if_true', 'val_if_false'). Otherwise, there was an error, that 'if' expected bool as 1st argument, but got string instead.
IMO this shouldn't happen, because parameters are of type bool, so they should be either bools or we should get an error at the very beginning of pipeline execution, rather than when passing parameter to a nested pipeline.
When the same parameters are used in 'If condition' blocks, they work fine (just parameter name is passed as a condition in expression).
I'm afraid I can't share logs of our internal stuff, but let me know if you need some assistance in reproducing the bug.
Thanks!
Edit: It all works fine when run from ADF, because there seems to be type validation/casting when user inputs param values.
Edit2: Btw. If Microsoft devs could just lookup pipeline runs, I'd provide a run id, which kinda demonstrates the issue:
- params are of type bool,
- you can see that provided values were true/false (note: it displays true/false when run from external API, in contrast to True/False when started from ADF. Maybe u guys missed a type cast/validation of params when running from .NET API?)
- one of these bool params causes error when evaluated as 1st argument of 'if' function in an expression. Error says that 'if' function expects bool, but got string instead.
Contributor guide
Assessment
This issue has not been assessed yet.