code: def inner_build_query(settings, query=None):
      query_segs = []
      for p in ["columnFilters", "outlierFilters"]:
          curr_filters = settings.get(p) or {}
          for col, filter_cfg in curr_filters.items():
              query_segs.append(filter_cfg["query"])
      if query not in [None, ""]:
          query_segs.append(query)
      joined_query_segs = " and ".join(query_segs)
      if joined_query_segs and settings.get("invertFilter", False):
          joined_query_segs = "~({})".format(joined_query_segs)
      return joined_query_segs
  
file_path: dtale/dtale/query.py
imports: import pandas
  import dtale.global_state
  from dtale.pandas_util import check_pandas_version
  from dtale.utils import format_data, get_bool_arg
label_desc: Use image node_id 3 for calling a global function with example usage: inner_build_query(settings, query) and returns: joined_query_segs