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 2022/04/28 13:40:21 UTC

[GitHub] [airflow] eladkal opened a new pull request, #23328: `GCSFileTransformOperator`: New templated fields `source_object`, `destination_object`

eladkal opened a new pull request, #23328:
URL: https://github.com/apache/airflow/pull/23328

   
   
   * Add `source_object`, `destination_object` as templated fields
   * fix docstring
   
   closes: #23327
   
   <!--
   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/main/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 a newsfragement file, named `{pr_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] josh-fell commented on a diff in pull request #23328: `GCSFileTransformOperator`: New templated fields `source_object`, `destination_object`

Posted by GitBox <gi...@apache.org>.
josh-fell commented on code in PR #23328:
URL: https://github.com/apache/airflow/pull/23328#discussion_r861044501


##########
airflow/providers/google/cloud/operators/gcs.py:
##########
@@ -536,8 +536,10 @@ class GCSFileTransformOperator(BaseOperator):
     data from source, transform it and write the output to the local
     destination file.
 
-    :param source_bucket: The key to be retrieved from GCS. (templated)
-    :param destination_bucket: The key to be written from GCS. (templated)
+    :param source_bucket: The bucket to locate the source_object. (templated)
+    :param source_object: The key to be retrieved from GCS. (templated)
+    :param destination_bucket: The bucket to upload the key after transformation. (templated)
+    :param destination_object: The key to be written in GCS. (templated)

Review Comment:
   To me, it seems better to be explicit rather than implicit here since this will appear in the Python API documentation rather than having to read the source code to figure it out.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] eladkal commented on a diff in pull request #23328: `GCSFileTransformOperator`: New templated fields `source_object`, `destination_object`

Posted by GitBox <gi...@apache.org>.
eladkal commented on code in PR #23328:
URL: https://github.com/apache/airflow/pull/23328#discussion_r860958473


##########
airflow/providers/google/cloud/operators/gcs.py:
##########
@@ -536,8 +536,10 @@ class GCSFileTransformOperator(BaseOperator):
     data from source, transform it and write the output to the local
     destination file.
 
-    :param source_bucket: The key to be retrieved from GCS. (templated)
-    :param destination_bucket: The key to be written from GCS. (templated)
+    :param source_bucket: The bucket to locate the source_object. (templated)
+    :param source_object: The key to be retrieved from GCS. (templated)
+    :param destination_bucket: The bucket to upload the key after transformation. (templated)
+    :param destination_object: The key to be written in GCS. (templated)

Review Comment:
   I think it implies since these parameters are optional but I can make this change if you think it's better :)



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] eladkal commented on a diff in pull request #23328: `GCSFileTransformOperator`: New templated fields `source_object`, `destination_object`

Posted by GitBox <gi...@apache.org>.
eladkal commented on code in PR #23328:
URL: https://github.com/apache/airflow/pull/23328#discussion_r861079953


##########
airflow/providers/google/cloud/operators/gcs.py:
##########
@@ -536,8 +536,10 @@ class GCSFileTransformOperator(BaseOperator):
     data from source, transform it and write the output to the local
     destination file.
 
-    :param source_bucket: The key to be retrieved from GCS. (templated)
-    :param destination_bucket: The key to be written from GCS. (templated)
+    :param source_bucket: The bucket to locate the source_object. (templated)
+    :param source_object: The key to be retrieved from GCS. (templated)
+    :param destination_bucket: The bucket to upload the key after transformation. (templated)
+    :param destination_object: The key to be written in GCS. (templated)

Review Comment:
   https://github.com/apache/airflow/pull/23328/commits/9be6c6e4f4a70d570c61593fa39a6ad02b6fdf00



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] nitinmuteja commented on pull request #23328: `GCSFileTransformOperator`: New templated fields `source_object`, `destination_object`

Posted by GitBox <gi...@apache.org>.
nitinmuteja commented on PR #23328:
URL: https://github.com/apache/airflow/pull/23328#issuecomment-1112933575

   Hi @eladkal ,
   When do we expect the library release?


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] eladkal merged pull request #23328: `GCSFileTransformOperator`: New templated fields `source_object`, `destination_object`

Posted by GitBox <gi...@apache.org>.
eladkal merged PR #23328:
URL: https://github.com/apache/airflow/pull/23328


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] eladkal commented on pull request #23328: `GCSFileTransformOperator`: New templated fields `source_object`, `destination_object`

Posted by GitBox <gi...@apache.org>.
eladkal commented on PR #23328:
URL: https://github.com/apache/airflow/pull/23328#issuecomment-1112937636

   probably somewhere around beginning of May


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] github-actions[bot] commented on pull request #23328: `GCSFileTransformOperator`: New templated fields `source_object`, `destination_object`

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

   The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main 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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] josh-fell commented on a diff in pull request #23328: `GCSFileTransformOperator`: New templated fields `source_object`, `destination_object`

Posted by GitBox <gi...@apache.org>.
josh-fell commented on code in PR #23328:
URL: https://github.com/apache/airflow/pull/23328#discussion_r860949164


##########
airflow/providers/google/cloud/operators/gcs.py:
##########
@@ -536,8 +536,10 @@ class GCSFileTransformOperator(BaseOperator):
     data from source, transform it and write the output to the local
     destination file.
 
-    :param source_bucket: The key to be retrieved from GCS. (templated)
-    :param destination_bucket: The key to be written from GCS. (templated)
+    :param source_bucket: The bucket to locate the source_object. (templated)
+    :param source_object: The key to be retrieved from GCS. (templated)
+    :param destination_bucket: The bucket to upload the key after transformation. (templated)
+    :param destination_object: The key to be written in GCS. (templated)

Review Comment:
   ```suggestion
       :param destination_bucket: The bucket to upload the key after transformation. If not provided, source_bucket will be used. (templated)
       :param destination_object: The key to be written in GCS. If not provided, source_object will be used. (templated)
   ```
   WDYT about letting users know the source_bucket/object will be used so they don't think they are required to provide either or both values?



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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