<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to pass results one by one from Notebook to Dataflow in Data Pipeline? in Pipelines</title>
    <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-pass-results-one-by-one-from-Notebook-to-Dataflow-in-Data/m-p/4265215#M6149</link>
    <description>&lt;P&gt;Here is the Notebook code I used for anyone who is looking for solution&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; json&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;df = spark.sql("&lt;/SPAN&gt;&lt;SPAN&gt;SELECT&lt;/SPAN&gt;&lt;SPAN&gt; Name &lt;/SPAN&gt;&lt;SPAN&gt;FROM&lt;/SPAN&gt;&lt;SPAN&gt; DE_LH_100_Bronze.TicketFullBulkFilelist &lt;/SPAN&gt;&lt;SPAN&gt;LIMIT&lt;/SPAN&gt; &lt;SPAN&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Convert the DataFrame to JSON format and collect the results&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;json_rdd = df.toJSON().collect()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# json_object now contains the data as a JSON-compatible list of dictionaries&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# print(json_rdd)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mssparkutils.notebook.exit(json_rdd)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 31 Oct 2024 08:29:50 GMT</pubDate>
    <dc:creator>TimoRiikonen</dc:creator>
    <dc:date>2024-10-31T08:29:50Z</dc:date>
    <item>
      <title>How to pass results one by one from Notebook to Dataflow in Data Pipeline?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-pass-results-one-by-one-from-Notebook-to-Dataflow-in-Data/m-p/4264060#M6132</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;We have too much data to import all of it on one go, so I am trying to import it one file at a time.&lt;/P&gt;&lt;P&gt;I have&lt;/P&gt;&lt;P&gt;- Notebook that reads a list of filenames and outputs it&lt;/P&gt;&lt;P&gt;- Planning to have: Dataflow to that will take one filename and import its contents to Lakehouse. Files are in XML format and I have written the extraction to dataflow already so I would rather use dataflow than notebook in here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And now I am trying to build a data pipeline with a simple foreach loop into it and I need help with this.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;activity(&lt;/SPAN&gt;&lt;SPAN&gt;'Read filelist'&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;output&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;The function 'length' expects its parameter to be an array or a string. The provided value is of type 'Object'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;activity(&lt;/SPAN&gt;&lt;SPAN&gt;'Read filelist'&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;output&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;value&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;The expression 'length(activity('Read filelist').output.value)' cannot be evaluated because property 'value' doesn't exist, available properties are 'runId, runStatus, sessionId, sparkPool, error, lastCheckedOn, metadata, highConcurrencyModeStatus, exitValue'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;activity(&lt;/SPAN&gt;&lt;SPAN&gt;'Read filelist'&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;output&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;result&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;The function 'length' expects its parameter to be an array or a string. The provided value is of type 'Object'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;activity(&lt;/SPAN&gt;&lt;SPAN&gt;'Read filelist'&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;output&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;result.value&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;The expression 'length(activity('Read filelist').output.result.value)' cannot be evaluated because property 'value' doesn't exist, available properties are 'runId, runStatus, sessionId, sparkPool, error, lastCheckedOn, metadata, highConcurrencyModeStatus, exitValue'.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 14:34:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-pass-results-one-by-one-from-Notebook-to-Dataflow-in-Data/m-p/4264060#M6132</guid>
      <dc:creator>TimoRiikonen</dc:creator>
      <dc:date>2024-10-30T14:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass results one by one from Notebook to Dataflow in Data Pipeline?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-pass-results-one-by-one-from-Notebook-to-Dataflow-in-Data/m-p/4264627#M6142</link>
      <description>&lt;P&gt;Step 1 - Have your Notebook create a JSON string from the list of filenames. e.g&amp;nbsp; &amp;nbsp; filenamelist = '["file1"."file2"]'&lt;BR /&gt;Step 2 - use the following to finish your notebook script.&amp;nbsp; &amp;nbsp; &amp;nbsp;notebookutils.notebook.exit(filenamelist)&lt;/P&gt;&lt;P&gt;Step 3 - On the foreach container, parse the exitValue into an array&amp;nbsp;Anonymous&lt;/LI-USER&gt;(&lt;SPAN&gt;activity(&lt;/SPAN&gt;&lt;SPAN&gt;'Read filelist'&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;output&lt;/SPAN&gt;&lt;SPAN&gt;.result.exitValue)&lt;BR /&gt;Step 4 - Inside the for each container you refer to each filename using &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="816487" data-lia-user-login="Item" class="lia-mention lia-mention-user"&gt;Item&lt;/a&gt;()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;See here for a similar problem:&amp;nbsp;&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/Data-Pipeline/Referencing-notebook-exit-value-as-a-variable-in-a-data-pipeline/m-p/3507053" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Data-Pipeline/Referencing-notebook-exit-value-as-a-variable-in-a-data-pipeline/m-p/3507053&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Incidentally this is the solution we've used to output a list of unprocessed items, as ADF expression language has a 'contains', but not a 'does not contain' collection function.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 00:21:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-pass-results-one-by-one-from-Notebook-to-Dataflow-in-Data/m-p/4264627#M6142</guid>
      <dc:creator>spencer_sa</dc:creator>
      <dc:date>2024-10-31T00:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass results one by one from Notebook to Dataflow in Data Pipeline?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-pass-results-one-by-one-from-Notebook-to-Dataflow-in-Data/m-p/4265213#M6148</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="679603" data-lia-user-login="spencer_sa" class="lia-mention lia-mention-user"&gt;spencer_sa&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;I managed steps 1 - 3 and possibly #4 as well, but data pipeline runs these concurrently, which would be a disaster.&lt;BR /&gt;Proof: All of the dataflows have the same starting time even though all of their duration is more than a second.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;These are the last lines from the JSON, so the concurrency should be one and thus I expected these to run sequentially:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"concurrency"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"lastModifiedByObjectId"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"d3444903-5e8a-433e-91e2-cdfbfb8816aa"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"lastPublishTime"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"2024-10-30T12:47:58Z"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 31 Oct 2024 08:28:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-pass-results-one-by-one-from-Notebook-to-Dataflow-in-Data/m-p/4265213#M6148</guid>
      <dc:creator>TimoRiikonen</dc:creator>
      <dc:date>2024-10-31T08:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass results one by one from Notebook to Dataflow in Data Pipeline?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-pass-results-one-by-one-from-Notebook-to-Dataflow-in-Data/m-p/4265215#M6149</link>
      <description>&lt;P&gt;Here is the Notebook code I used for anyone who is looking for solution&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; json&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;df = spark.sql("&lt;/SPAN&gt;&lt;SPAN&gt;SELECT&lt;/SPAN&gt;&lt;SPAN&gt; Name &lt;/SPAN&gt;&lt;SPAN&gt;FROM&lt;/SPAN&gt;&lt;SPAN&gt; DE_LH_100_Bronze.TicketFullBulkFilelist &lt;/SPAN&gt;&lt;SPAN&gt;LIMIT&lt;/SPAN&gt; &lt;SPAN&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Convert the DataFrame to JSON format and collect the results&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;json_rdd = df.toJSON().collect()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# json_object now contains the data as a JSON-compatible list of dictionaries&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# print(json_rdd)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mssparkutils.notebook.exit(json_rdd)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 31 Oct 2024 08:29:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-pass-results-one-by-one-from-Notebook-to-Dataflow-in-Data/m-p/4265215#M6149</guid>
      <dc:creator>TimoRiikonen</dc:creator>
      <dc:date>2024-10-31T08:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass results one by one from Notebook to Dataflow in Data Pipeline?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-pass-results-one-by-one-from-Notebook-to-Dataflow-in-Data/m-p/4265347#M6150</link>
      <description>&lt;P&gt;I'd have thought to ensure the ForEach items get processed sequentially you'd need to make sure that the 'Sequential' checkbox is ticked in the ForEach step;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;(or if you prefer your pipeline in JSON format)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 09:53:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-pass-results-one-by-one-from-Notebook-to-Dataflow-in-Data/m-p/4265347#M6150</guid>
      <dc:creator>spencer_sa</dc:creator>
      <dc:date>2024-10-31T09:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass results one by one from Notebook to Dataflow in Data Pipeline?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-to-pass-results-one-by-one-from-Notebook-to-Dataflow-in-Data/m-p/4265414#M6153</link>
      <description>&lt;PRE&gt;Ok, sequential setting was right there.&lt;BR /&gt;Next issue: How to pass the filename to dataflow?&lt;BR /&gt;I can define parameters in dataflow, but I can't test this except by running the data pipeline I believe.&lt;BR /&gt;&lt;BR /&gt;I did 2 attempts to pass parameters, does either of them work?&lt;BR /&gt;&lt;BR /&gt; "activities": [&lt;BR /&gt;{&lt;BR /&gt;"name": "Dataflow1",&lt;BR /&gt;"type": "RefreshDataflow",&lt;BR /&gt;"dependsOn": [],&lt;BR /&gt;"policy": {&lt;BR /&gt;"timeout": "0.12:00:00",&lt;BR /&gt;"retry": 0,&lt;BR /&gt;"retryIntervalInSeconds": 30,&lt;BR /&gt;"secureOutput": false,&lt;BR /&gt;"secureInput": false&lt;BR /&gt;},&lt;BR /&gt;"isSequential": true,&lt;BR /&gt;"parameters": {&lt;BR /&gt;"FileName1": {&lt;BR /&gt;"value": "@item()",&lt;BR /&gt;"type": "string"&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;"inputs": [&lt;BR /&gt;{&lt;BR /&gt;"referenceName": "MyInputDataset",&lt;BR /&gt;"type": "DatasetReference",&lt;BR /&gt;"parameters": {&lt;BR /&gt;"FileName2": "@item()"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Oct 2024 10:57:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-to-pass-results-one-by-one-from-Notebook-to-Dataflow-in-Data/m-p/4265414#M6153</guid>
      <dc:creator>TimoRiikonen</dc:creator>
      <dc:date>2024-10-31T10:57:53Z</dc:date>
    </item>
  </channel>
</rss>

