microsoft / data-factory-testing-framework

A stand-alone test framework that allows to write unit tests for Data Factory pipelines on Microsoft Fabric and Azure Data Factory.
MIT License
68 stars 15 forks source link

Evaluate function activity() in string attribute #112

Closed pol-defont-reaulx closed 2 weeks ago

pol-defont-reaulx commented 1 month ago

Hey,

I checked for it but didn't find anything in the code to handle it.

In a Copy Activity in a Data Factory pipeline, I add a WHERE condition in the typeProperties.source.sqlReaderQuery to filter using a date I got in a previous activity. The function I'm using looks like: @{string(activity('GetIncrementalFilterDate').output.firstRow.min_date)}

It would be good to be able to access to a result argument like the other expressions

arjendev commented 1 month ago

Hi @pol-defont-reaulx,

Sorry for my late reply, I was on holiday!

If the sqlReaderQuery is an expression, then the framework should automatically parse it as such and become available as a DataFactoryElement.

The following should be available: activity.type_properties["source"]["sqlReaderQuery"].result.

Feel free to share your pipeline definition here so that I can fully understand your context, thanks!

pol-defont-reaulx commented 2 weeks ago

Hi @arjendev,

My problem was that sqlReaderQuery was not marked as an expression and was a direct equal. Changing that made it works :)

Sorry for bothering you on this