from concurrent.futures import ThreadPoolExecutor # This is the Snowflake thread pool executor. It prevents uncontrolled number # of threads from being spawned when executing queries in parallel. # This is a workaround to the fact that the Snowflake connector does not # support async operations and is blocking. Limit to a relatively # low number of workers to prevent consumption of too many resources. sf_executor = ThreadPoolExecutor(max_workers=8)