You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/12/16 22:25:04 UTC

[GitHub] [airflow] mik-laj opened a new pull request #13117: Update compatibility with google-cloud-redis==2.0.0

mik-laj opened a new pull request #13117:
URL: https://github.com/apache/airflow/pull/13117


   Part of: https://github.com/apache/airflow/issues/12116
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #13117: Update compatibility with google-cloud-redis==2.0.0

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #13117:
URL: https://github.com/apache/airflow/pull/13117#discussion_r546591519



##########
File path: airflow/providers/google/cloud/example_dags/example_cloud_memorystore.py
##########
@@ -161,7 +161,7 @@
     set_acl_permission = GCSBucketCreateAclEntryOperator(
         task_id="gcs-set-acl-permission",
         bucket=BUCKET_NAME,
-        entity="user-{{ task_instance.xcom_pull('get-instance')['persistenceIamIdentity']"
+        entity="user-{{ task_instance.xcom_pull('get-instance')['persistence_iam_identity']"

Review comment:
       In this case, I think we should put that change on hold and release it together with other breaking changes for google provider. I do not think we have an immediate need to migrate to this new '2.0.0' version. And this should happen IMHO at the point we add more breaking changes together.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #13117: Update compatibility with google-cloud-redis==2.0.0

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #13117:
URL: https://github.com/apache/airflow/pull/13117#discussion_r546591519



##########
File path: airflow/providers/google/cloud/example_dags/example_cloud_memorystore.py
##########
@@ -161,7 +161,7 @@
     set_acl_permission = GCSBucketCreateAclEntryOperator(
         task_id="gcs-set-acl-permission",
         bucket=BUCKET_NAME,
-        entity="user-{{ task_instance.xcom_pull('get-instance')['persistenceIamIdentity']"
+        entity="user-{{ task_instance.xcom_pull('get-instance')['persistence_iam_identity']"

Review comment:
       In this case, I think we should put that change on hold and release/merge it together with other breaking changes for google provider. I do not think we have an immediate need to migrate to this new '2.0.0' version. And this should happen IMHO at the point we add more breaking changes together.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #13117: Update compatibility with google-cloud-redis==2.0.0

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #13117:
URL: https://github.com/apache/airflow/pull/13117#discussion_r546863031



##########
File path: airflow/providers/google/cloud/example_dags/example_cloud_memorystore.py
##########
@@ -161,7 +161,7 @@
     set_acl_permission = GCSBucketCreateAclEntryOperator(
         task_id="gcs-set-acl-permission",
         bucket=BUCKET_NAME,
-        entity="user-{{ task_instance.xcom_pull('get-instance')['persistenceIamIdentity']"
+        entity="user-{{ task_instance.xcom_pull('get-instance')['persistence_iam_identity']"

Review comment:
       All right - after the discussion - seems like we have more breaking changes in this "batch" so this will be fine to make it backwards incompatible and set version to 2.0.0




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #13117: Update compatibility with google-cloud-redis==2.0.0

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #13117:
URL: https://github.com/apache/airflow/pull/13117#issuecomment-748083937


   [The Workflow run](https://github.com/apache/airflow/actions/runs/430540854) is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #13117: Update compatibility with google-cloud-redis==2.0.0

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #13117:
URL: https://github.com/apache/airflow/pull/13117#discussion_r546346852



##########
File path: airflow/providers/google/cloud/example_dags/example_cloud_memorystore.py
##########
@@ -161,7 +161,7 @@
     set_acl_permission = GCSBucketCreateAclEntryOperator(
         task_id="gcs-set-acl-permission",
         bucket=BUCKET_NAME,
-        entity="user-{{ task_instance.xcom_pull('get-instance')['persistenceIamIdentity']"
+        entity="user-{{ task_instance.xcom_pull('get-instance')['persistence_iam_identity']"

Review comment:
       Is the list of those modified fields known and fixed ? I guess it should be as it comes from the old version of library which is not going to be updated. I guess the values in Xcom come from another operator of ours, and they contain the values returned by `CloudMemorystoreGetInstanceOperator` - result of `MessageToDict` method call?
   
   I guess in this case we could -  potentially make it backwards-compatible by modifying the dictionary returned and copying the values with legacy field names?  How feasible it is ? Maybe in the new library there is already a fixed list of values or even a code that we could use to do it ?

##########
File path: airflow/providers/google/ADDITIONAL_INFO.md
##########
@@ -0,0 +1,62 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+# Migration Guide
+
+# Next

Review comment:
       I think we need to specify version here. And I think this is a very good way to make backwards incompatible changes here- by adding version number here that indicates what kind of changes we are talking about.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #13117: Update compatibility with google-cloud-redis==2.0.0

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #13117:
URL: https://github.com/apache/airflow/pull/13117#issuecomment-748685721


   [The Workflow run](https://github.com/apache/airflow/actions/runs/434600912) is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on a change in pull request #13117: Update compatibility with google-cloud-redis==2.0.0

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #13117:
URL: https://github.com/apache/airflow/pull/13117#discussion_r545816457



##########
File path: airflow/providers/google/cloud/example_dags/example_cloud_memorystore.py
##########
@@ -161,7 +161,7 @@
     set_acl_permission = GCSBucketCreateAclEntryOperator(
         task_id="gcs-set-acl-permission",
         bucket=BUCKET_NAME,
-        entity="user-{{ task_instance.xcom_pull('get-instance')['persistenceIamIdentity']"
+        entity="user-{{ task_instance.xcom_pull('get-instance')['persistence_iam_identity']"

Review comment:
       I added docs.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on a change in pull request #13117: Update compatibility with google-cloud-redis==2.0.0

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #13117:
URL: https://github.com/apache/airflow/pull/13117#discussion_r545754145



##########
File path: airflow/providers/google/cloud/example_dags/example_cloud_memorystore.py
##########
@@ -161,7 +161,7 @@
     set_acl_permission = GCSBucketCreateAclEntryOperator(
         task_id="gcs-set-acl-permission",
         bucket=BUCKET_NAME,
-        entity="user-{{ task_instance.xcom_pull('get-instance')['persistenceIamIdentity']"
+        entity="user-{{ task_instance.xcom_pull('get-instance')['persistence_iam_identity']"

Review comment:
       This will be very problematic because this is changed in the third library and we are just passing that object as JSON. These are the consequences of the fact that our operators are only wrappers on the API and the abstraction layer between the third library and the DAG is relatively thin.
   
   In my opinion, we need to introduce a breaking change. Otherwise, we will be forced to use old and outdated libraries that will not allow us to use new API fields/features.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #13117: Update compatibility with google-cloud-redis==2.0.0

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #13117:
URL: https://github.com/apache/airflow/pull/13117#issuecomment-748074791


   The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest master at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #13117: Update compatibility with google-cloud-redis==2.0.0

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #13117:
URL: https://github.com/apache/airflow/pull/13117#discussion_r545750424



##########
File path: airflow/providers/google/cloud/example_dags/example_cloud_memorystore.py
##########
@@ -161,7 +161,7 @@
     set_acl_permission = GCSBucketCreateAclEntryOperator(
         task_id="gcs-set-acl-permission",
         bucket=BUCKET_NAME,
-        entity="user-{{ task_instance.xcom_pull('get-instance')['persistenceIamIdentity']"
+        entity="user-{{ task_instance.xcom_pull('get-instance')['persistence_iam_identity']"

Review comment:
       CAan we keep backwards-compatibility? I think we should change our approach and only introduce backwards-incompatible changes in providers if we absolutely must and there is no other way to solve it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #13117: Update compatibility with google-cloud-redis==2.0.0

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #13117:
URL: https://github.com/apache/airflow/pull/13117#issuecomment-747088431


   [The Workflow run](https://github.com/apache/airflow/actions/runs/426799289) is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] turbaszek commented on a change in pull request #13117: Update compatibility with google-cloud-redis==2.0.0

Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #13117:
URL: https://github.com/apache/airflow/pull/13117#discussion_r544686164



##########
File path: airflow/providers/google/cloud/example_dags/example_cloud_memorystore.py
##########
@@ -161,7 +161,7 @@
     set_acl_permission = GCSBucketCreateAclEntryOperator(
         task_id="gcs-set-acl-permission",
         bucket=BUCKET_NAME,
-        entity="user-{{ task_instance.xcom_pull('get-instance')['persistenceIamIdentity']"
+        entity="user-{{ task_instance.xcom_pull('get-instance')['persistence_iam_identity']"

Review comment:
       Does this suggest a breaking change?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on a change in pull request #13117: Update compatibility with google-cloud-redis==2.0.0

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #13117:
URL: https://github.com/apache/airflow/pull/13117#discussion_r545026617



##########
File path: airflow/providers/google/cloud/example_dags/example_cloud_memorystore.py
##########
@@ -161,7 +161,7 @@
     set_acl_permission = GCSBucketCreateAclEntryOperator(
         task_id="gcs-set-acl-permission",
         bucket=BUCKET_NAME,
-        entity="user-{{ task_instance.xcom_pull('get-instance')['persistenceIamIdentity']"
+        entity="user-{{ task_instance.xcom_pull('get-instance')['persistence_iam_identity']"

Review comment:
       Yes. Unfortunately yes. Upgrading the library version introduces minor behavioral differences, so we will have to add an update entry for these libraries in UPDATING.md.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on a change in pull request #13117: Update compatibility with google-cloud-redis==2.0.0

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #13117:
URL: https://github.com/apache/airflow/pull/13117#discussion_r546445948



##########
File path: airflow/providers/google/cloud/example_dags/example_cloud_memorystore.py
##########
@@ -161,7 +161,7 @@
     set_acl_permission = GCSBucketCreateAclEntryOperator(
         task_id="gcs-set-acl-permission",
         bucket=BUCKET_NAME,
-        entity="user-{{ task_instance.xcom_pull('get-instance')['persistenceIamIdentity']"
+        entity="user-{{ task_instance.xcom_pull('get-instance')['persistence_iam_identity']"

Review comment:
       There is one more problem. If we try to rename the keys, then it will not be possible to create an object using this dictionary.
   ```
   instance_dict = t.xcom_pull('get-instance')
   instance = Instance(**instance_dict)
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #13117: Update compatibility with google-cloud-redis==2.0.0

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #13117:
URL: https://github.com/apache/airflow/pull/13117#issuecomment-749128127


   The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest master at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on a change in pull request #13117: Update compatibility with google-cloud-redis==2.0.0

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #13117:
URL: https://github.com/apache/airflow/pull/13117#discussion_r546444580



##########
File path: airflow/providers/google/cloud/example_dags/example_cloud_memorystore.py
##########
@@ -161,7 +161,7 @@
     set_acl_permission = GCSBucketCreateAclEntryOperator(
         task_id="gcs-set-acl-permission",
         bucket=BUCKET_NAME,
-        entity="user-{{ task_instance.xcom_pull('get-instance')['persistenceIamIdentity']"
+        entity="user-{{ task_instance.xcom_pull('get-instance')['persistence_iam_identity']"

Review comment:
       The word list is not provided explicitly, but we may try to guess these names when comparing types with similar names in the new version of the library, but this will require creating a large key mapping from one version of the library to the new library.  This key list is also not fixed as new versions of libraries may contain new keys. 
   
   This has its limitation. If we only replace dict keys based on a predefined list of keys, we can accidentally modify user values as well, because Google libraries not often, but sometimes also store values from the user as a key.
   https://github.com/googleapis/googleapis/blob/eabe7c0fde64b1451df6ea171b2009238b0df07c/google/cloud/datacatalog/v1/tags.proto#L79
   https://github.com/googleapis/googleapis/blob/eabe7c0fde64b1451df6ea171b2009238b0df07c/google/cloud/redis/v1/cloud_redis.proto#L276
   For this not to happen, we may collect such cases as path, but we will still have to maintain them. 
   
   PS. Google uses the snake_case convention in protobuff, so with this change, Google tried to standardize all field names. 
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #13117: Update compatibility with google-cloud-redis==2.0.0

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #13117:
URL: https://github.com/apache/airflow/pull/13117#discussion_r546346852



##########
File path: airflow/providers/google/cloud/example_dags/example_cloud_memorystore.py
##########
@@ -161,7 +161,7 @@
     set_acl_permission = GCSBucketCreateAclEntryOperator(
         task_id="gcs-set-acl-permission",
         bucket=BUCKET_NAME,
-        entity="user-{{ task_instance.xcom_pull('get-instance')['persistenceIamIdentity']"
+        entity="user-{{ task_instance.xcom_pull('get-instance')['persistence_iam_identity']"

Review comment:
       Is the list of those modified fields known and fixed ? I guess it should be as it comes from the old version of library which is not going to be updated. I guess the values in Xcom come from another operator of ours, and they contain the values returned by `CloudMemorystoreGetInstanceOperator` - result of `MessageToDict` method call?
   
   I guess in this case we could -  potentially - make it backwards-compatible by modifying the dictionary returned and copying the values with legacy field names?  How feasible it is ? Maybe in the new library there is already a fixed list of values or even a code that we could use to do it ?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #13117: Update compatibility with google-cloud-redis==2.0.0

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #13117:
URL: https://github.com/apache/airflow/pull/13117#issuecomment-748552732


   [The Workflow run](https://github.com/apache/airflow/actions/runs/433248808) is cancelling this PR. Building images for the PR has failed. Follow the the workflow link to check the reason.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mik-laj merged pull request #13117: Update compatibility with google-cloud-redis>=2.0.0

Posted by GitBox <gi...@apache.org>.
mik-laj merged pull request #13117:
URL: https://github.com/apache/airflow/pull/13117


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org