title: In SQLAlchemy how can I filter my query to only include rows with non-empty jsonb column values?
body: <p>I have a DB table that I am querying, simplified example looks like this:</p>
  <pre class="lang-sql prettyprint-override"><code>+----------+---------+----------------------------------------------------------------------------------------------------------------+
  | entry_id | list_id | availability                                                                                                   |
  |----------+---------+----------------------------------------------------------------------------------------------------------------|
  | 130      | 199     | {&quot;2021-10-20&quot;: {&quot;value&quot;: &quot;no_reply&quot;, &quot;notify&quot;: false}, &quot;2021-10-21&quot;: {&quot;value&quot;: &quot;no_reply&quot;, &quot;notify&quot;: false}}   |
  | 131      | 199     | {&quot;2021-10-20&quot;: {&quot;value&quot;: &quot;no_reply&quot;, &quot;notify&quot;: false}, &quot;2021-10-21&quot;: {&quot;value&quot;: &quot;no_reply&quot;, &quot;notify&quot;: false}}   |
  | 132      | 199     | {}                                                                                                             |
  | 129      | 199     | {&quot;2021-10-20&quot;: {&quot;value&quot;: &quot;available&quot;, &quot;notify&quot;: false}, &quot;2021-10-21&quot;: {&quot;value&quot;: &quot;available&quot;, &quot;notify&quot;: false}} |
  +----------+---------+----------------------------------------------------------------------------------------------------------------+
  </code></pre>
  <p>In my query I only want to include the rows where the availability column dict has keys, and filter out any empty ones (eg. entry_id 132) with the default value of &quot;{}&quot;</p>
  <p>I've achieved some success with using <code>ListEntry.availability != '&quot;{}&quot;'</code> as a filter in my query, but it seems a bit hacky and I was wondering if there was a better way of doing it?</p>