data-factory-testing-framework icon indicating copy to clipboard operation
data-factory-testing-framework copied to clipboard

Check types of RunParameter to catch errors and give user feedback

Open LeonardHd opened this issue 1 year ago • 4 comments

ADF only supports specific data types for what we call RunParameter and PipelineRunVariable.

We support python primitives that map to the data factory types. For RunParameters this should be:

  • str -> String,
  • int -> Int,
  • float -> Float,
  • bool -> Bool
  • list -> Array
  • dict -> Object
  • str -> SecureString

For PipelineRunVariable these should be:

  • str -> String,
  • bool -> Boolean,
  • list-> Array,
  • int-> Integer,

Currently we do not validate any value on RunParameter and PipelineRunVariable.

LeonardHd avatar Mar 13 '24 13:03 LeonardHd

Hi @LeonardHd, I can work on this.

yehiaelbehery avatar Apr 17 '24 20:04 yehiaelbehery

@yehiaelbehery Thanks for offering help. I will share some more details as this might help. The example might be a bit too ambiguous, so I will collect some more details tomorrow 👍

LeonardHd avatar Apr 18 '24 15:04 LeonardHd

@arjendev I updated the issue. In fact, we do not validate anything at the moment in the framework. I think simple guard clauses would be enough so only valid RunParameter and PipelineRunVariable could be instantiated. What do you think?

@yehiaelbehery let's see what Arjen's point of view here is, as he leads the API concepts.

LeonardHd avatar Apr 24 '24 06:04 LeonardHd

Sounds good!

@LeonardHd, perhaps we can also introduce the check to verify we pass in the right type of the output argument in activity.set_result and the output argument in state.add_activity_result. These should only accept dictionary and lists iirc. This was the place where you accidently pushed in a tuple and got an internal error, right?

arjendev avatar Apr 24 '24 13:04 arjendev