Skip to content

Commit

Permalink
Update alias for field_mask in Google Memmcache (apache#16975)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
potiuk committed Jul 13, 2021
1 parent 9ff781a commit a3f5c93
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 8 additions & 8 deletions airflow/providers/google/cloud/hooks/cloud_memorystore.py
Expand Up @@ -487,8 +487,8 @@ def update_instance(
- ``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
Expand Down Expand Up @@ -871,7 +871,7 @@ def list_instances(
@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,
Expand All @@ -889,9 +889,9 @@ def update_instance(
- ``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
Expand Down Expand Up @@ -935,7 +935,7 @@ def update_instance(
@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,
Expand All @@ -951,9 +951,9 @@ def update_parameters(
: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`
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Expand Up @@ -292,7 +292,9 @@ def write_version(filename: str = os.path.join(*[my_dir, "airflow", "git_version
'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',
Expand Down

0 comments on commit a3f5c93

Please sign in to comment.