<?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: Asset Bundles : how to conditionally set content of a template file in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/asset-bundles-how-to-conditionally-set-content-of-a-template/m-p/77242#M35424</link>
    <description>&lt;P&gt;Never mind....I figured out the solution &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I just have to prefix my template file with ".tmpl", then it gets rendered correctly&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jul 2024 07:43:39 GMT</pubDate>
    <dc:creator>GeKo</dc:creator>
    <dc:date>2024-07-09T07:43:39Z</dc:date>
    <item>
      <title>Asset Bundles : how to conditionally set content of a template file</title>
      <link>https://community.databricks.com/t5/data-engineering/asset-bundles-how-to-conditionally-set-content-of-a-template/m-p/77236#M35422</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;since Asset Bundles is based on GO templating mechanism, I am wondering how it is possible to use IF-ELSE construct within a template file, to define which file content will be set in the generated file ( I want to have that in my custom template).&lt;/P&gt;&lt;P&gt;Example: I am providing a boolean variable "topic_sourcing" to the &lt;EM&gt;bundle init&lt;/EM&gt; command. The following template file shall be set, depending on that variable:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;---
version: "1.0"
{{- if .topic_sourcing }}
status: enabled
topics:
  - name: "my-name"
    table_name: "my-tablename"
{{- else }}
status: disabled   
{{- end }}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But after the &lt;EM&gt;bundle init&lt;/EM&gt; command, it looks like there is no templating mechanism applied on the file, means the created file contains exactly the text shown above.&lt;/P&gt;&lt;P&gt;How can I populate a file content based on a variable during bundle init ??&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 07:15:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/asset-bundles-how-to-conditionally-set-content-of-a-template/m-p/77236#M35422</guid>
      <dc:creator>GeKo</dc:creator>
      <dc:date>2024-07-09T07:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Asset Bundles : how to conditionally set content of a template file</title>
      <link>https://community.databricks.com/t5/data-engineering/asset-bundles-how-to-conditionally-set-content-of-a-template/m-p/77242#M35424</link>
      <description>&lt;P&gt;Never mind....I figured out the solution &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I just have to prefix my template file with ".tmpl", then it gets rendered correctly&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 07:43:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/asset-bundles-how-to-conditionally-set-content-of-a-template/m-p/77242#M35424</guid>
      <dc:creator>GeKo</dc:creator>
      <dc:date>2024-07-09T07:43:39Z</dc:date>
    </item>
  </channel>
</rss>

