code: def table_id(connection, table_name, schema_name=None):
      """Fetch the id for schema.table_name, defaulting to current schema if
      schema is None
      """
  
      schema_idm = schema_id(
          connection=connection, schema_name=schema_name
      )
  
      q = f"""
          SELECT id
          FROM sys.tables
          WHERE name = '{table_name}'
          AND schema_id = {schema_idm}
          """
  
      cur = connection.cursor()
      cur.execute(q)
  
      try:
          table_id = cur.fetchall()[0][0]
      except:
          raise exc.NoSuchTableError(table_name)
  
      return table_id
  
label_desc: Use image node_id 2 for calling a global function with example usage: table_id(connection, table_name, schema_name) and returns: table_id