class_docstr: A class for handling connections and interactions with the Google Content API for Shopping.
class_docstr_tok: ["A","class","for","handling","connections","and","interactions","with","the","Google","Content","API","for","Shopping","."]
docstr: Update products
  Args:
      params (dict): query parameters
  Returns:
      DataFrame
docstr_tok: ["Update","products","Args",":","params","(","dict",")",":","query","parameters","Returns",":","DataFrame"]
code: def update_products(self, params: dict = None) -> DataFrame:
      """
      Update products
      Args:
          params (dict): query parameters
      Returns:
          DataFrame
      """
      body = {
          key: value
          for key, value in params.items()
          if key in self.products.get_columns()
      }
      service = self.connect()
      if params["product_id"]:
          result = (
              service.products()
              .update(
                  merchantId=self.merchant_id,
                  productId=params["product_id"],
                  updateMask=params["updateMask"],
                  body=body,
              )
              .execute()
          )
  
          return result
      else:
          df = pd.DataFrame(columns=["productId", "status"])
          if not params["startId"]:
              start_id = int(params["endId"]) - 10
          elif not params["endId"]:
              end_id = int(params["startId"]) + 10
          else:
              start_id = int(params["startId"])
              end_id = int(params["endId"])
  
          for i in range(start_id, end_id):
              service.products().update(
                  merchantId=self.merchant_id,
                  productId=i,
                  updateMask=params["updateMask"],
                  body=body,
              ).execute()
              df = pd.concat(
                  [
                      df,
                      pd.DataFrame(
                          [{"productId": str(i), "status": "updated"}]
                      ),
                  ],
                  ignore_index=True,
              )
          return df
  
imports: import json
  from collections import OrderedDict
  from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE
  import pandas
  from pandas import DataFrame
  from google.auth.transport.requests import Request
  from google.oauth2 import service_account
  from google.oauth2.credentials import Credentials
  from googleapiclient.discovery import build
  from mindsdb.api.executor.data_types.response_type import RESPONSE_TYPE
  from .google_content_shopping_tables import AccountsTable, OrdersTable, ProductsTable
  from mindsdb.integrations.libs.api_handler import APIHandler, FuncParser
  from mindsdb.integrations.libs.response import HandlerStatusResponse, HandlerResponse
  from mindsdb.utilities import log
label_desc: Use image node_id 10 for calling the GoogleContentShoppingHandler obj's underlying member method code with example usage: obj.update_products(params) and returns: result, df