From 79fb35710508d37ce1be36bfd7a98cd3e1cb504b Mon Sep 17 00:00:00 2001
From: Kaxil Naik <kaxilnaik@gmail.com>
Date: Tue, 1 Mar 2022 21:05:24 +0000
Subject: [PATCH 1/3] Unpin `google-cloud-memcache`

This was pinned in July 2021 - https://github.com/apache/airflow/pull/16975/files
---
 .../cloud/example_dags/example_cloud_memorystore.py       | 4 ++--
 .../providers/google/cloud/operators/cloud_memorystore.py | 8 ++++----
 setup.py                                                  | 4 +---
 3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/airflow/providers/google/cloud/example_dags/example_cloud_memorystore.py b/airflow/providers/google/cloud/example_dags/example_cloud_memorystore.py
index 8abd72eae2496..6f9dd09ff3d36 100644
--- a/airflow/providers/google/cloud/example_dags/example_cloud_memorystore.py
+++ b/airflow/providers/google/cloud/example_dags/example_cloud_memorystore.py
@@ -21,8 +21,8 @@
 import os
 from datetime import datetime
 
-from google.cloud.memcache_v1beta2.types import cloud_memcache
 from google.cloud.redis_v1 import FailoverInstanceRequest, Instance
+from google.protobuf.field_mask_pb2 import FieldMask
 
 from airflow import models
 from airflow.operators.bash import BashOperator
@@ -305,7 +305,7 @@
         location="europe-north1",
         instance_id=MEMORYSTORE_MEMCACHED_INSTANCE_NAME,
         project_id=GCP_PROJECT_ID,
-        update_mask=cloud_memcache.field_mask.FieldMask(paths=["node_count"]),
+        update_mask=FieldMask(paths=["node_count"]),
         instance={"node_count": 2},
     )
     # [END howto_operator_update_instance_memcached]
diff --git a/airflow/providers/google/cloud/operators/cloud_memorystore.py b/airflow/providers/google/cloud/operators/cloud_memorystore.py
index cca8e3a40d4da..675452b819ba2 100644
--- a/airflow/providers/google/cloud/operators/cloud_memorystore.py
+++ b/airflow/providers/google/cloud/operators/cloud_memorystore.py
@@ -1406,7 +1406,7 @@ class CloudMemorystoreMemcachedUpdateInstanceOperator(BaseOperator):
         -  ``displayName``
 
         If a dict is provided, it must be of the same form as the protobuf message
-        :class:`~google.cloud.memcache_v1beta2.types.cloud_memcache.field_mask.FieldMas`
+        :class:`~google.protobuf.field_mask_pb2.FieldMask`
 
     .. seealso::
         For more information on how to use this operator, take a look at the guide:
@@ -1452,7 +1452,7 @@ class CloudMemorystoreMemcachedUpdateInstanceOperator(BaseOperator):
     def __init__(
         self,
         *,
-        update_mask: Union[Dict, cloud_memcache.field_mask.FieldMask],
+        update_mask: Union[Dict, FieldMask],
         instance: Union[Dict, cloud_memcache.Instance],
         location: Optional[str] = None,
         instance_id: Optional[str] = None,
@@ -1504,8 +1504,8 @@ class CloudMemorystoreMemcachedUpdateParametersOperator(BaseOperator):
 
     :param update_mask: Required. Mask of fields to update.
         If a dict is provided, it must be of the same form as the protobuf message
-        :class:`~google.cloud.memcache_v1beta2.types.cloud_memcache.field_mask.FieldMask`
-        Union[Dict, google.cloud.memcache_v1beta2.types.cloud_memcache.field_mask.FieldMask]
+        :class:`~google.protobuf.field_mask_pb2.FieldMask`
+        Union[Dict, google.protobuf.field_mask_pb2.FieldMask]
     :param parameters: The parameters to apply to the instance.
         If a dict is provided, it must be of the same form as the protobuf message
         :class:`~google.cloud.memcache_v1beta2.types.cloud_memcache.MemcacheParameters`
diff --git a/setup.py b/setup.py
index f89f0db63c18a..5c2ae3b9f6c01 100644
--- a/setup.py
+++ b/setup.py
@@ -334,9 +334,7 @@ def write_version(filename: str = os.path.join(*[my_dir, "airflow", "git_version
     'google-cloud-kms>=2.0.0',
     'google-cloud-language>=1.1.1,<2.0.0',
     'google-cloud-logging>=2.1.1',
-    # 1.1.0 removed field_mask and broke import for released providers
-    # We can remove the <1.1.0 limitation after we release new Google Provider
-    'google-cloud-memcache>=0.2.0,<1.1.0',
+    'google-cloud-memcache>=0.2.0',
     'google-cloud-monitoring>=2.0.0',
     'google-cloud-os-login>=2.0.0',
     'google-cloud-orchestration-airflow>=1.0.0,<2.0.0',

From 8a94d32b20d52e89b425f1c48a44af29967e8ab3 Mon Sep 17 00:00:00 2001
From: Kaxil Naik <kaxilnaik@gmail.com>
Date: Tue, 1 Mar 2022 22:48:52 +0000
Subject: [PATCH 2/3] Update cloud_memorystore.py

---
 airflow/providers/google/cloud/operators/cloud_memorystore.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/airflow/providers/google/cloud/operators/cloud_memorystore.py b/airflow/providers/google/cloud/operators/cloud_memorystore.py
index 675452b819ba2..19caf6d476bfc 100644
--- a/airflow/providers/google/cloud/operators/cloud_memorystore.py
+++ b/airflow/providers/google/cloud/operators/cloud_memorystore.py
@@ -1536,7 +1536,7 @@ class CloudMemorystoreMemcachedUpdateParametersOperator(BaseOperator):
     def __init__(
         self,
         *,
-        update_mask: Union[Dict, cloud_memcache.field_mask.FieldMask],
+        update_mask: Union[Dict, FieldMask],
         parameters: Union[Dict, cloud_memcache.MemcacheParameters],
         location: str,
         instance_id: str,

From c323f31c52581ff72033c33daf4de66da32a3cfe Mon Sep 17 00:00:00 2001
From: Kaxil Naik <kaxilnaik@gmail.com>
Date: Wed, 2 Mar 2022 00:24:37 +0000
Subject: [PATCH 3/3] Update
 airflow/providers/google/cloud/operators/cloud_memorystore.py

---
 airflow/providers/google/cloud/operators/cloud_memorystore.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/airflow/providers/google/cloud/operators/cloud_memorystore.py b/airflow/providers/google/cloud/operators/cloud_memorystore.py
index 19caf6d476bfc..d02bdb09b3495 100644
--- a/airflow/providers/google/cloud/operators/cloud_memorystore.py
+++ b/airflow/providers/google/cloud/operators/cloud_memorystore.py
@@ -1505,7 +1505,6 @@ class CloudMemorystoreMemcachedUpdateParametersOperator(BaseOperator):
     :param update_mask: Required. Mask of fields to update.
         If a dict is provided, it must be of the same form as the protobuf message
         :class:`~google.protobuf.field_mask_pb2.FieldMask`
-        Union[Dict, google.protobuf.field_mask_pb2.FieldMask]
     :param parameters: The parameters to apply to the instance.
         If a dict is provided, it must be of the same form as the protobuf message
         :class:`~google.cloud.memcache_v1beta2.types.cloud_memcache.MemcacheParameters`
