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/04/07 12:29:13 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #15232: S3Hook.load_file should accept Path object in addition to str

uranusjr commented on a change in pull request #15232:
URL: https://github.com/apache/airflow/pull/15232#discussion_r608607269



##########
File path: airflow/providers/amazon/aws/hooks/s3.py
##########
@@ -494,6 +495,7 @@ def load_file(
             uploaded to the S3 bucket.
         :type acl_policy: str
         """
+        filename = filename.as_posix() if isinstance(filename, Path) else filename

Review comment:
       What is the semantic meaning of `filename` here, a file on the local filesystem, or a path in the S3 bucket? If it’s the latter, this should be `Union[str, PurePosixPath]` instead, and just use `str()` for coercion.




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