File tree Expand file tree Collapse file tree
src/robusta/core/sinks/robusta/dal Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010from cachetools import TTLCache
1111import requests
1212from postgrest ._sync .request_builder import SyncQueryRequestBuilder
13- from postgrest .base_request_builder import BaseFilterRequestBuilder
13+ from postgrest .base_request_builder import BaseFilterRequestBuilder , QueryArgs
1414from postgrest .exceptions import APIError as PostgrestAPIError
1515from postgrest .types import ReturnMethod
1616from postgrest .utils import sanitize_param
3737 AccountResourceStatusType ,
3838 ResourceKind ,
3939)
40+ from postgrest ._sync import request_builder as supabase_request_builder
41+
4042
4143SERVICES_TABLE = "Services"
4244NODES_TABLE = "Nodes"
5557OPENSHIFT_GROUPS_TABLE = "OpenshiftGroups"
5658SESSION_TOKENS_TABLE = "AuthTokens"
5759
60+
61+ logging .info ("Patching supabase_request_builder.pre_select" )
62+ original_pre_select = supabase_request_builder .pre_select
63+ def pre_select_patched (* args , ** kwargs ):
64+ args : QueryArgs = original_pre_select (* args , ** kwargs )
65+ if not args .json :
66+ args = QueryArgs (args .method , args .params , args .headers , None )
67+
68+ return args
69+ supabase_request_builder .pre_select = pre_select_patched
70+
71+
5872class SupabaseDal (AccountResourceFetcher ):
5973 def __init__ (
6074 self ,
You can’t perform that action at this time.
0 commit comments