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 2021/05/03 16:28:11 UTC

[GitHub] [airflow] monti-python opened a new pull request #15637: Update wasb.py

monti-python opened a new pull request #15637:
URL: https://github.com/apache/airflow/pull/15637


   closes: #15636
   
   


-- 
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] ephraimbuddy commented on a change in pull request #15637: Fix WasbHook.delete_file broken when using prefix

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



##########
File path: airflow/providers/microsoft/azure/hooks/wasb.py
##########
@@ -407,7 +407,7 @@ def delete_file(
         :type kwargs: object
         """
         if is_prefix:
-            blobs_to_delete = self.get_blobs_list(container_name, prefix=blob_name, **kwargs)
+            blobs_to_delete = self.get_blobs_list(container_name, prefix=blob_name, delimiter='', **kwargs)

Review comment:
       I prefer this delimiter is not hardcoded.




-- 
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] monti-python commented on a change in pull request #15637: Fix WasbHook.delete_file broken when using prefix

Posted by GitBox <gi...@apache.org>.
monti-python commented on a change in pull request #15637:
URL: https://github.com/apache/airflow/pull/15637#discussion_r625564602



##########
File path: airflow/providers/microsoft/azure/hooks/wasb.py
##########
@@ -407,7 +407,7 @@ def delete_file(
         :type kwargs: object
         """
         if is_prefix:
-            blobs_to_delete = self.get_blobs_list(container_name, prefix=blob_name, **kwargs)
+            blobs_to_delete = self.get_blobs_list(container_name, prefix=blob_name, delimiter='', **kwargs)

Review comment:
       Hi @ephraimbuddy, thanks a lot for reviewing. 
   
   Using a delimiter other than the empty string `''` might lead to non-terminal blob _paths_. Would you suggest declaring the delimiter as a local variable, and then passing it to `get_blobs_list` instead?




-- 
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] ephraimbuddy commented on a change in pull request #15637: Fix WasbHook.delete_file broken when using prefix

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



##########
File path: airflow/providers/microsoft/azure/hooks/wasb.py
##########
@@ -407,7 +407,7 @@ def delete_file(
         :type kwargs: object
         """
         if is_prefix:
-            blobs_to_delete = self.get_blobs_list(container_name, prefix=blob_name, **kwargs)
+            blobs_to_delete = self.get_blobs_list(container_name, prefix=blob_name, delimiter='', **kwargs)

Review comment:
       Yes @monti-python , I suggest that the delete_file method takes a delimiter argument with default of ''(empty string)




-- 
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] ephraimbuddy merged pull request #15637: Fix WasbHook.delete_file broken when using prefix

Posted by GitBox <gi...@apache.org>.
ephraimbuddy merged pull request #15637:
URL: https://github.com/apache/airflow/pull/15637


   


-- 
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] monti-python closed pull request #15637: Update wasb.py

Posted by GitBox <gi...@apache.org>.
monti-python closed pull request #15637:
URL: https://github.com/apache/airflow/pull/15637


   


-- 
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] ephraimbuddy commented on pull request #15637: Fix WasbHook.delete_file broken when using prefix

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on pull request #15637:
URL: https://github.com/apache/airflow/pull/15637#issuecomment-832112456


   Congrats @monti-python :rocket: 


-- 
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] ephraimbuddy commented on a change in pull request #15637: Fix WasbHook.delete_file broken when using prefix

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



##########
File path: tests/providers/microsoft/azure/hooks/test_wasb.py
##########
@@ -234,10 +234,11 @@ def test_delete_single_blob(self, delete_blobs, mock_service):
     @mock.patch.object(WasbHook, 'check_for_blob')
     def test_delete_multiple_blobs(self, mock_check, mock_get_blobslist, mock_delete_blobs):
         mock_check.return_value = False
+        # below return value only true if delimiter == ''

Review comment:
       ```suggestion
          
   ```




-- 
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 #15637: Fix WasbHook.delete_file broken when using prefix

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


   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 master 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] monti-python commented on a change in pull request #15637: Fix WasbHook.delete_file broken when using prefix

Posted by GitBox <gi...@apache.org>.
monti-python commented on a change in pull request #15637:
URL: https://github.com/apache/airflow/pull/15637#discussion_r625596530



##########
File path: airflow/providers/microsoft/azure/hooks/wasb.py
##########
@@ -407,7 +407,7 @@ def delete_file(
         :type kwargs: object
         """
         if is_prefix:
-            blobs_to_delete = self.get_blobs_list(container_name, prefix=blob_name, **kwargs)
+            blobs_to_delete = self.get_blobs_list(container_name, prefix=blob_name, delimiter='', **kwargs)

Review comment:
       Brilliant, so the user could limit the deletion depth by specifying a custom `delimiter` and `ignore_if_missing = True`. Thanks for that @ephraimbuddy ! PR updated




-- 
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] boring-cyborg[bot] commented on pull request #15637: Update wasb.py

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #15637:
URL: https://github.com/apache/airflow/pull/15637#issuecomment-831377004


   Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst)
   Here are some useful points:
   - Pay attention to the quality of your code (flake8, pylint and type annotations). Our [pre-commits]( https://github.com/apache/airflow/blob/master/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks) will help you with that.
   - In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/master/docs/apache-airflow/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
   - Consider using [Breeze environment](https://github.com/apache/airflow/blob/master/BREEZE.rst) for testing locally, itโ€™s a heavy docker but it ships with a working Airflow and a lot of integrations.
   - Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
   - Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
   - Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#coding-style-and-best-practices).
   Apache Airflow is a community-driven project and together we are making it better ๐Ÿš€.
   In case of doubts contact the developers at:
   Mailing List: dev@airflow.apache.org
   Slack: https://s.apache.org/airflow-slack
   


-- 
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] boring-cyborg[bot] commented on pull request #15637: Fix WasbHook.delete_file broken when using prefix

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #15637:
URL: https://github.com/apache/airflow/pull/15637#issuecomment-832111531


   Awesome work, congrats on your first merged pull request!
   


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