This is an automated email from the ASF dual-hosted git repository. potiuk pushed a commit to branch v2-1-test in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 37c935d601ff6c3f501fcfab3bf1b57665fddbc1 Author: Jarek Potiuk <ja...@potiuk.com> AuthorDate: Tue Jul 13 20:54:38 2021 +0200 Update alias for field_mask in Google Memmcache (#16975) The July 12 2021 release of google-memcache library removed field_mask alias from the library which broke our typechecking and made google provider unimportable. This PR fixes the import to use the actual import. (cherry picked from commit a3f5c93806258b5ad396a638ba0169eca7f9d065) --- .../providers/google/cloud/hooks/cloud_memorystore.py | 16 ++++++++-------- setup.py | 4 +++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/airflow/providers/google/cloud/hooks/cloud_memorystore.py b/airflow/providers/google/cloud/hooks/cloud_memorystore.py index caf1cd6..8f4165b 100644 --- a/airflow/providers/google/cloud/hooks/cloud_memorystore.py +++ b/airflow/providers/google/cloud/hooks/cloud_memorystore.py @@ -487,8 +487,8 @@ class CloudMemorystoreHook(GoogleBaseHook): - ``redisConfig`` If a dict is provided, it must be of the same form as the protobuf message - :class:`~google.cloud.redis_v1.types.FieldMask` - :type update_mask: Union[Dict, google.cloud.redis_v1.types.FieldMask] + :class:`~google.protobuf.field_mask_pb2.FieldMask` + :type update_mask: Union[Dict, google.protobuf.field_mask_pb2.FieldMask] :param instance: Required. Update description. Only fields specified in ``update_mask`` are updated. If a dict is provided, it must be of the same form as the protobuf message @@ -871,7 +871,7 @@ class CloudMemorystoreMemcachedHook(GoogleBaseHook): @GoogleBaseHook.fallback_to_default_project_id def update_instance( self, - update_mask: Union[Dict, cloud_memcache.field_mask.FieldMask], + update_mask: Union[Dict, FieldMask], instance: Union[Dict, cloud_memcache.Instance], project_id: str, location: Optional[str] = None, @@ -889,9 +889,9 @@ class CloudMemorystoreMemcachedHook(GoogleBaseHook): - ``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.FieldMask` + :class:`~google.protobuf.field_mask_pb2.FieldMask`) :type update_mask: - Union[Dict, google.cloud.memcache_v1beta2.types.cloud_memcache.field_mask.FieldMask] + Union[Dict, google.protobuf.field_mask_pb2.FieldMask] :param instance: Required. Update description. Only fields specified in ``update_mask`` are updated. If a dict is provided, it must be of the same form as the protobuf message @@ -935,7 +935,7 @@ class CloudMemorystoreMemcachedHook(GoogleBaseHook): @GoogleBaseHook.fallback_to_default_project_id def update_parameters( self, - update_mask: Union[Dict, cloud_memcache.field_mask.FieldMask], + update_mask: Union[Dict, FieldMask], parameters: Union[Dict, cloud_memcache.MemcacheParameters], project_id: str, location: str, @@ -951,9 +951,9 @@ class CloudMemorystoreMemcachedHook(GoogleBaseHook): :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` + :class:`~google.protobuf.field_mask_pb2.FieldMask` :type update_mask: - Union[Dict, google.cloud.memcache_v1beta2.types.cloud_memcache.field_mask.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 9dde824..46ff73d 100644 --- a/setup.py +++ b/setup.py @@ -292,7 +292,9 @@ google = [ 'google-cloud-kms>=2.0.0,<3.0.0', 'google-cloud-language>=1.1.1,<2.0.0', 'google-cloud-logging>=2.1.1,<3.0.0', - 'google-cloud-memcache>=0.2.0', + # 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-monitoring>=2.0.0,<3.0.0', 'google-cloud-os-login>=2.0.0,<3.0.0', 'google-cloud-pubsub>=2.0.0,<3.0.0',