<?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: List budget policies applying filter_by in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/list-budget-policies-applying-filter-by/m-p/142405#M51939</link>
    <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/110502"&gt;@szymon_dybczak&lt;/a&gt;,&amp;nbsp;you are a legend, saved me a lot of time.&lt;/P&gt;</description>
    <pubDate>Tue, 23 Dec 2025 09:36:08 GMT</pubDate>
    <dc:creator>ahsan_aj</dc:creator>
    <dc:date>2025-12-23T09:36:08Z</dc:date>
    <item>
      <title>List budget policies applying filter_by</title>
      <link>https://community.databricks.com/t5/data-engineering/list-budget-policies-applying-filter-by/m-p/128244#M48186</link>
      <description>&lt;P&gt;I'm trying to list budget policies using the parameter "filter_by" to filter policies that start with "aaaa" but I'm getting an error&amp;nbsp; "400 Bad Request"&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;{'error_code': 'MALFORMED_REQUEST', 'message': "Could not parse request object: Expected 'START_OBJECT' not 'VALUE_STRING'\n at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 15]\n at [Source: UNKNOWN; line: 1, column: 15]", 'details': [{'@type': 'type.googleapis.com/google.rpc.RequestInfo', 'request_id': '525465a2-3c47-45f1-8528-523b2a4f77b0', 'serving_data': ''}]}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Using:&lt;/P&gt;&lt;PRE&gt;url = &lt;A href="https://community.databricks.com/" target="_blank"&gt;https://accounts.azuredatabricks.net/api/2.1/accounts/&amp;lt;account_id&amp;gt;/budget-policies&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;headers = {&lt;BR /&gt;'Authorization': f'Bearer &amp;lt;TOKEN&amp;gt;',&lt;BR /&gt;'Accept': 'application/json'&lt;BR /&gt;}&lt;BR /&gt;params = {"filter_by":{"policy_name":"aaaa"}}&lt;BR /&gt;response = requests.get(url=url, headers=headers, params=params)&lt;/PRE&gt;&lt;P&gt;Is this parameter functional?&lt;/P&gt;&lt;P&gt;using as reference:&amp;nbsp;&lt;A href="https://docs.databricks.com/api/azure/account/budgetpolicy/list" target="_blank"&gt;https://docs.databricks.com/api/azure/account/budgetpolicy/list&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2025 15:16:43 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/list-budget-policies-applying-filter-by/m-p/128244#M48186</guid>
      <dc:creator>fkseki</dc:creator>
      <dc:date>2025-08-12T15:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: List budget policies applying filter_by</title>
      <link>https://community.databricks.com/t5/data-engineering/list-budget-policies-applying-filter-by/m-p/128249#M48188</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/69634"&gt;@fkseki&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Since filter_by is an object parameter in a GET request, I think that you need to convert it to a JSON string when passing it as a query parameter. Try to do something like this:&lt;/P&gt;&lt;P&gt;filter_by_json = json.dumps({"policy_name": "aaaa"})&lt;BR /&gt;params = {"filter_by": filter_by_json}&lt;BR /&gt;response = requests.get(url=url, headers=headers, params=params)&lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2025 16:04:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/list-budget-policies-applying-filter-by/m-p/128249#M48188</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2025-08-12T16:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: List budget policies applying filter_by</title>
      <link>https://community.databricks.com/t5/data-engineering/list-budget-policies-applying-filter-by/m-p/128252#M48189</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/69634"&gt;@fkseki&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The filter_by parameter is functional, but the error you’re seeing is because you’re passing it as a&lt;BR /&gt;Python dict in params — which requests will serialize into query string format — whereas the API&lt;BR /&gt;expects a JSON object in the request body for this particular endpoint.&lt;/P&gt;&lt;P&gt;For the list call in the Databricks Budget Policy API, filter_by isn’t a plain query parameter; it’s part&lt;BR /&gt;of the request payload (POST), even though it’s a “list” operation&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import requests
import json

url = f"https://accounts.azuredatabricks.net/api/2.1/accounts/{account_id}/budget-policies/list"

headers = {
    "Authorization": f"Bearer {TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json"
}

payload = {
    "filter_by": {
        "policy_name": "aaaa"
    }
}

response = requests.post(url, headers=headers, data=json.dumps(payload))
print(response.status_code, response.text)&lt;/LI-CODE&gt;&lt;P&gt;Key differences from your attempt:&lt;BR /&gt;The method should be POST, not GET.&lt;BR /&gt;The filter_by object should be in the request body as JSON, not in params.&lt;BR /&gt;The URL is usually &amp;lt;...&amp;gt;/budget-policies/list rather than just /budget-policies.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2025 16:25:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/list-budget-policies-applying-filter-by/m-p/128252#M48189</guid>
      <dc:creator>lingareddy_Alva</dc:creator>
      <dc:date>2025-08-12T16:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: List budget policies applying filter_by</title>
      <link>https://community.databricks.com/t5/data-engineering/list-budget-policies-applying-filter-by/m-p/128337#M48211</link>
      <description>&lt;P&gt;Thanks for the reply,&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/110502"&gt;@szymon_dybczak&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/24053"&gt;@lingareddy_Alva&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;I tried both approaches but none was successful.&lt;/P&gt;&lt;PRE&gt;url = f'{account_url}/api/2.1/accounts/{account_id}/budget-policies'&lt;BR /&gt;&lt;BR /&gt;filter_by_json = json.dumps({"policy_name": "aaaa"})&lt;BR /&gt;params = {"filter_by": filter_by_json}&lt;BR /&gt;&lt;BR /&gt;headers = {&lt;BR /&gt;&lt;SPAN&gt; 'Authorization': f'Bearer {TOKEN}',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 'Accept': 'application/json',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 'Content-Type': 'application/json'&lt;/SPAN&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;response = requests.get(url=url, headers=headers, params=params)&lt;/PRE&gt;&lt;PRE&gt;params = {"filter_by":{"policy_name":"aaes"}}&lt;BR /&gt;response = requests.post(url=url, headers=headers, data=json.dumps(params))&lt;/PRE&gt;&lt;P&gt;For the post method, I tried with and without the "/list" at the end of the endpoint.&lt;/P&gt;&lt;P&gt;With it I got an&amp;nbsp;&lt;SPAN&gt;ENDPOINT_NOT_FOUND error&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Without it, the INVALID_PARAMETER_VALUE error, probably because this endpoint with POST method is to be used to &lt;A href="https://docs.databricks.com/api/azure/account/budgetpolicy/create" target="_self"&gt;create a new budget policy&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;'error_code': 'INVALID_PARAMETER_VALUE', 'message': 'Invalid policyName - policy name cannot be empty'&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2025 12:34:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/list-budget-policies-applying-filter-by/m-p/128337#M48211</guid>
      <dc:creator>fkseki</dc:creator>
      <dc:date>2025-08-13T12:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: List budget policies applying filter_by</title>
      <link>https://community.databricks.com/t5/data-engineering/list-budget-policies-applying-filter-by/m-p/128349#M48215</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/69634"&gt;@fkseki&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Oh man, after 1,5 hour of trail and error I've found a way to make it work &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; You need to use dot notation and it will work. They shoud've specified this in docs though...&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;params = {"filter_by.policy_name": "szymon - genric"}

headers = {
 'Authorization': f'Bearer {TOKEN}',
 'Accept': 'application/json',
 'Content-Type': 'application/json'
}

response = requests.get(url=url, headers=headers, params=params)

data = response.json()
print("SUCCESS!")
print(json.dumps(data, indent=2))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2025 14:35:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/list-budget-policies-applying-filter-by/m-p/128349#M48215</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2025-08-13T14:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: List budget policies applying filter_by</title>
      <link>https://community.databricks.com/t5/data-engineering/list-budget-policies-applying-filter-by/m-p/128358#M48218</link>
      <description>&lt;P&gt;Wonderful! It works! Thank you very much, I tried many different ways but didn't think to test this one, though.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2025 17:03:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/list-budget-policies-applying-filter-by/m-p/128358#M48218</guid>
      <dc:creator>fkseki</dc:creator>
      <dc:date>2025-08-13T17:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: List budget policies applying filter_by</title>
      <link>https://community.databricks.com/t5/data-engineering/list-budget-policies-applying-filter-by/m-p/128359#M48219</link>
      <description>&lt;P&gt;No problem &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/69634"&gt;@fkseki&lt;/a&gt;. It was interesting, but at the same time frustrating experience &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; Good that we managed to solve it.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2025 17:09:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/list-budget-policies-applying-filter-by/m-p/128359#M48219</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2025-08-13T17:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: List budget policies applying filter_by</title>
      <link>https://community.databricks.com/t5/data-engineering/list-budget-policies-applying-filter-by/m-p/142405#M51939</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/110502"&gt;@szymon_dybczak&lt;/a&gt;,&amp;nbsp;you are a legend, saved me a lot of time.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Dec 2025 09:36:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/list-budget-policies-applying-filter-by/m-p/142405#M51939</guid>
      <dc:creator>ahsan_aj</dc:creator>
      <dc:date>2025-12-23T09:36:08Z</dc:date>
    </item>
  </channel>
</rss>

