<?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 How to return the function result instead of the function syntax of a variable? in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/how-to-return-the-function-result-instead-of-the-function-syntax/m-p/82126#M7996</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to get the certain value of my variable in the for loop but it's returning the syntax instead of the value. Also, is it possible to covert this value to an integer? Thanks&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zll_0091_0-1723013056629.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/10175iDC41C256483C3FC3/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="zll_0091_0-1723013056629.png" alt="zll_0091_0-1723013056629.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Aug 2024 06:44:58 GMT</pubDate>
    <dc:creator>zll_0091</dc:creator>
    <dc:date>2024-08-07T06:44:58Z</dc:date>
    <item>
      <title>How to return the function result instead of the function syntax of a variable?</title>
      <link>https://community.databricks.com/t5/get-started-discussions/how-to-return-the-function-result-instead-of-the-function-syntax/m-p/82126#M7996</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to get the certain value of my variable in the for loop but it's returning the syntax instead of the value. Also, is it possible to covert this value to an integer? Thanks&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zll_0091_0-1723013056629.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/10175iDC41C256483C3FC3/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="zll_0091_0-1723013056629.png" alt="zll_0091_0-1723013056629.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 06:44:58 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/how-to-return-the-function-result-instead-of-the-function-syntax/m-p/82126#M7996</guid>
      <dc:creator>zll_0091</dc:creator>
      <dc:date>2024-08-07T06:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to return the function result instead of the function syntax of a variable?</title>
      <link>https://community.databricks.com/t5/get-started-discussions/how-to-return-the-function-result-instead-of-the-function-syntax/m-p/82133#M7997</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/113366"&gt;@zll_0091&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Could you provide more code? What's inside dsfd variable? What's your expected outcome?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 07:51:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/how-to-return-the-function-result-instead-of-the-function-syntax/m-p/82133#M7997</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2024-08-07T07:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to return the function result instead of the function syntax of a variable?</title>
      <link>https://community.databricks.com/t5/get-started-discussions/how-to-return-the-function-result-instead-of-the-function-syntax/m-p/82141#M7998</link>
      <description>&lt;P&gt;Hi Slash,&lt;/P&gt;&lt;P&gt;dsfd&amp;nbsp;is just dbutils.fs.ls of my source path.&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Output: [Column&amp;lt;'substring(process_run_key=661962868/, 16, 26)'&amp;gt;] &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Expected Output: [661962868]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I just want to get the integer of that specific folder.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 08:49:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/how-to-return-the-function-result-instead-of-the-function-syntax/m-p/82141#M7998</guid>
      <dc:creator>zll_0091</dc:creator>
      <dc:date>2024-08-07T08:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to return the function result instead of the function syntax of a variable?</title>
      <link>https://community.databricks.com/t5/get-started-discussions/how-to-return-the-function-result-instead-of-the-function-syntax/m-p/82151#M7999</link>
      <description>&lt;P&gt;So, in my opinion you're doing it wrong. The&lt;SPAN&gt;&amp;nbsp;dbutils.fs.ls will return python list. You're using substring function from pyspark.sql.functions which is not needed in this case.&lt;BR /&gt;As an example, I created dsfd variable with following content&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Slash_1-1723023091145.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/10180i4D99C36CCBECC219/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="Slash_1-1723023091145.png" alt="Slash_1-1723023091145.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then I can iterate over this list in the following way. Let's say that I only need path from dbutils.fs.ls output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;for row in dsfd:
    print(row.path)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 09:33:16 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/how-to-return-the-function-result-instead-of-the-function-syntax/m-p/82151#M7999</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2024-08-07T09:33:16Z</dc:date>
    </item>
  </channel>
</rss>

